Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Support apptainer sif #278

Merged
merged 1 commit into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/dal/migrations/mysql/0001_initialize.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ CREATE TABLE IF NOT EXISTS `artifacts` (
`raw` MEDIUMBLOB NOT NULL,
`config_raw` MEDIUMBLOB,
`config_media_type` varchar(256),
`type` ENUM ('Image', 'ImageIndex', 'Chart', 'Cnab', 'Wasm', 'Provenance', 'Cosign', 'Unknown') NOT NULL DEFAULT 'Unknown',
`type` ENUM ('Image', 'ImageIndex', 'Chart', 'Cnab', 'Wasm', 'Provenance', 'Cosign', 'Sif', 'Unknown') NOT NULL DEFAULT 'Unknown',
`pushed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`last_pull` timestamp,
`pull_times` bigint NOT NULL DEFAULT 0,
Expand Down
1 change: 1 addition & 0 deletions pkg/dal/migrations/postgresql/0001_initialize.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ CREATE TYPE artifact_type AS ENUM (
'Wasm',
'Provenance',
'Cosign',
'Sif',
'Unknown'
);

Expand Down
2 changes: 1 addition & 1 deletion pkg/dal/migrations/sqlite3/0001_initialize.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ CREATE TABLE IF NOT EXISTS `artifacts` (
`raw` BLOB NOT NULL,
`config_raw` BLOB,
`config_media_type` varchar(256),
`type` text CHECK (`type` IN ('Image', 'ImageIndex', 'Chart', 'Cnab', 'Wasm', 'Provenance', 'Cosign', 'Unknown')) NOT NULL DEFAULT 'Unknown',
`type` text CHECK (`type` IN ('Image', 'ImageIndex', 'Chart', 'Cnab', 'Wasm', 'Provenance', 'Cosign', 'Sif', 'Unknown')) NOT NULL DEFAULT 'Unknown',
`pushed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`last_pull` timestamp,
`referrer_id` integer,
Expand Down
4 changes: 3 additions & 1 deletion pkg/handlers/distribution/manifest/manifest_put.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
}
} else {
for _, reference := range manifest.References() {
if reference.MediaType == "application/vnd.oci.image.config.v1+json" || reference.MediaType == "application/vnd.docker.container.image.v1+json" || reference.MediaType == "application/vnd.cncf.helm.config.v1+json" {
if reference.MediaType == "application/vnd.oci.image.config.v1+json" || reference.MediaType == "application/vnd.docker.container.image.v1+json" || reference.MediaType == "application/vnd.cncf.helm.config.v1+json" || reference.MediaType == "application/vnd.sylabs.sif.config.v1+json" {
configRawReader, err := storage.Driver.Reader(ctx, path.Join(consts.Blobs, utils.GenPathByDigest(reference.Digest)), 0)
if err != nil {
log.Error().Err(err).Str("digest", reference.Digest.String()).Msg("Get image config raw layer failed")
Expand Down Expand Up @@ -451,6 +451,8 @@
return enums.ArtifactTypeWasm
case "application/vnd.cncf.helm.config.v1+json":
return enums.ArtifactTypeChart
case "application/vnd.sylabs.sif.config.v1+json":
return enums.ArtifactTypeSif

Check warning on line 455 in pkg/handlers/distribution/manifest/manifest_put.go

View check run for this annotation

Codecov / codecov/patch

pkg/handlers/distribution/manifest/manifest_put.go#L454-L455

Added lines #L454 - L455 were not covered by tests
}
return enums.ArtifactTypeUnknown
}
Expand Down
1 change: 1 addition & 0 deletions pkg/types/enums/enums.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ type SortMethod string
// Wasm,
// Provenance,
// Cosign,
// Sif,
// Unknown,
// )
type ArtifactType string
Expand Down
9 changes: 6 additions & 3 deletions pkg/types/enums/enums_enum.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions web/src/pages/Tag/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default function Tag({ localServer }: { localServer: string }) {
}, [namespace, repository])

const fetchTags = () => {
let url = localServer + `/api/v1/namespaces/${namespaceId}/repositories/${repositoryId}/tags/?repository=${repository}&limit=${Settings.PageSize}&page=${page}&type=Image&type=ImageIndex&type=Chart`;
let url = localServer + `/api/v1/namespaces/${namespaceId}/repositories/${repositoryId}/tags/?repository=${repository}&limit=${Settings.PageSize}&page=${page}&type=Image&type=ImageIndex&type=Chart&type=Sif`;
if (searchTag !== "") {
url += `&name=${searchTag}`;
}
Expand Down Expand Up @@ -272,7 +272,7 @@ export default function Tag({ localServer }: { localServer: string }) {

{/* second row begin */}
<div className="text-xs text-gray-600">
Last pushed <span className="font-semibold">{dayjs().to(dayjs(tag.pushed_at))}</span>
Last pushed <span className="font-semibold">{dayjs().to(dayjs.utc(tag.pushed_at).tz(dayjs.tz.guess()))}</span>
</div>
<div className="mt-2 text-xs text-gray-600">
Pull times <span className="font-semibold">{tag.pull_times === undefined ? 0 : tag.pull_times}</span>
Expand Down