lablup / lablup/backend.ai

Relax Image Tag Validation Policy

Open
#5,979 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
17h 7m
Merged PRs (30d)
358

Description

## Overview

Backend.AI currently enforces strict image tag validation that rejects some valid image tags from external registries. This epic aims to relax the validation policy to allow arbitrary tag names while improving the GUI to display parseable tags as structured labels and unparseable tags as-is.

## Current Issues

1. **Overly Restrictive Tag Validation**: `rx_slug` pattern restricts start/end characters
1. **Limited Version Parsing**: `\d+(?:\.\d+)*[a-z0-9]*` pattern doesn't support `rc`, `post`, `alpha` version formats
1. **Platform Tag Limitations**: Hyphen-based structure enforcement rejects various Docker Hub tag formats

## Goals

1. **Backend**: Relax InvalidImageTag exceptions to allow arbitrary tag names
1. **GUI**: Display parseable tags as multi-labels, unparseable tags as raw strings
1. **Version Parsing**: Extend support for rc, post, alpha, beta version formats

## Key Files to Modify

- `src/ai/backend/common/docker.py:366` - Extend `_rx_ver` pattern
- `src/ai/backend/common/docker.py:563` - Relax `rx_slug` validation
- `src/ai/backend/common/exception.py:62` - Update InvalidImageTag definition

## Expected Benefits

- Improved compatibility with Docker Hub/Harbor external registry tags
- Enhanced user experience (structured display for parseable tags, raw display for others)
- Maintained backward compatibility

## Acceptance Criteria

- [ ] Allow tags like `pytorch:2.1-rc1`, `tensorflow:2.12.0-post1`
- [ ] Display unparseable tags as original strings in GUI
- [ ] Continue showing structured tags as multi-labels
- [ ] Resolve tag validation errors during registry scanning

JIRA Issue: BA-2454

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.