From a447d8f73e6011b3cc3a00c069392b9ffa99e751 Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Mon, 24 Feb 2025 13:46:18 +0100 Subject: [PATCH 1/3] added route doc Signed-off-by: munishchouhan --- typespec/routes.tsp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/typespec/routes.tsp b/typespec/routes.tsp index dd1a8678c..fb65157a7 100644 --- a/typespec/routes.tsp +++ b/typespec/routes.tsp @@ -15,12 +15,14 @@ namespace wave { @route("/v1alpha2/container") interface ContainerService { + @doc("This endpoint allows you to submit a request to access a private container registry via Wave, or build a container image on-the-fly with a Dockerfile or Conda recipe file and returns the name of the container request made available by Wave.") @post op createContainer(@body requestBody: ContainerRequest): { @body response: ContainerResponse; @statusCode statusCode: 200; }; @route("/{requestId}") + @doc("This endpoint allows you to get the details of a container request made to Wave.") @get op getContainerDetails(@path requestId: string): { @body response: WaveContainerRecord; @statusCode statusCode: 200; @@ -29,6 +31,7 @@ namespace wave { }; @route("/{requestId}/status") + @doc("This endpoint allows you to get the status of a container request made to Wave.") @get op getContainerStatus(@path requestId: string): { @body response: ContainerStatusResponse; @statusCode statusCode: 200; @@ -40,6 +43,7 @@ namespace wave { @route("/v1alpha1/builds/{buildId}") interface BuildService { + @doc("Provides status of build against buildId passed as path variable.") @get op getBuildRecord(@path buildId: string): { @body response: WaveBuildRecord; @statusCode statusCode: 200; @@ -48,6 +52,7 @@ namespace wave { }; @route("/status") + @doc("Provides status of build against buildId passed as path variable.") @get op getBuildStatus(@path buildId: string): { @body response: BuildStatusResponse; @statusCode statusCode: 200; @@ -56,6 +61,7 @@ namespace wave { }; @route("/logs") + @doc("Supply logs corresponding to the specified buildId within the API request.") @get op getBuildLogs(@path buildId: string): { @body response: string; @statusCode statusCode: 200; @@ -67,7 +73,7 @@ namespace wave { @route("/v1alpha1/scans/{scanId}") interface scanService{ - + @doc("This endpoint allows you to get the details of a container scan request made to Wave.") @get op scanImage(@path scanId: string) : { @body response: WaveScanRecord; @statusCode statusCode: 200; @@ -79,7 +85,7 @@ namespace wave { @route("/v1alpha1/inspect") interface InspectService { - + @doc("This endpoint returns the metadata about provided container image.") @post op inspectContainer(@body requestBody: ContainerInspectRequest): { @body response: ContainerInspectResponse; @statusCode statusCode: 200; @@ -90,12 +96,14 @@ namespace wave { } @route("/v1alpha2/validate-creds") + @doc("This endpoint allows you to validate the credentials of a container registry.") @post op validateCredsV2(@body request: ValidateRegistryCredsRequest): boolean; @route("/v1alpha1/mirrors") interface getMirrorRecord { @route("/{mirrorId}") + @doc("This endpoint allows you to get the details of a container mirror request made to Wave.") @get op containerMirror(@path mirrorId: string): { @body response: ContainerMirrorResponse; @statusCode statusCode: 200; From b20802d559f6f7665ec68da896de2933aa23c955 Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Mon, 24 Feb 2025 18:07:35 +0100 Subject: [PATCH 2/3] added examples Signed-off-by: munishchouhan --- typespec/models/BuildStatusResponse.tsp | 8 ++++ typespec/models/CondaOpts.tsp | 7 ++- .../{Packages.tsp => CondaPackages.tsp} | 4 +- typespec/models/ContainerConfig.tsp | 15 ++++++ typespec/models/ContainerInspectConfig.tsp | 22 ++++++++- typespec/models/ContainerInspectRequest.tsp | 8 +++- typespec/models/ContainerInspectResponse.tsp | 48 ++++++++++++++++++- typespec/models/ContainerLayer.tsp | 7 +++ typespec/models/ContainerMirrorResponse.tsp | 16 +++++++ typespec/models/ContainerPlatform.tsp | 5 ++ typespec/models/ContainerRequest.tsp | 27 +++++++---- typespec/models/ContainerResponse.tsp | 13 +++++ typespec/models/ContainerStatusResponse.tsp | 16 +++++-- typespec/models/Manifest.tsp | 18 ++++++- typespec/models/ManifestLayer.tsp | 7 ++- typespec/models/RootFS.tsp | 7 +++ typespec/models/User.tsp | 5 ++ .../models/ValidateRegistryCredsRequest.tsp | 6 ++- typespec/models/Vulnerability.tsp | 11 ++++- typespec/models/WaveBuildRecord.tsp | 1 + 20 files changed, 228 insertions(+), 23 deletions(-) rename typespec/models/{Packages.tsp => CondaPackages.tsp} (78%) diff --git a/typespec/models/BuildStatusResponse.tsp b/typespec/models/BuildStatusResponse.tsp index d54133e1b..35b203e47 100644 --- a/typespec/models/BuildStatusResponse.tsp +++ b/typespec/models/BuildStatusResponse.tsp @@ -1,6 +1,14 @@ import "./Status.tsp"; @doc("Response payload for build status.") +@example(#{ + id:"6c084f2e43f86a78_1", + status:Status.COMPLETED, + startTime:"2024-04-09T20:31:35.355423Z", + duration: "123.914989000", + succeeded: true +} +) model BuildStatusResponse { duration: string; id: string; diff --git a/typespec/models/CondaOpts.tsp b/typespec/models/CondaOpts.tsp index f1c94356a..38c16ed0a 100644 --- a/typespec/models/CondaOpts.tsp +++ b/typespec/models/CondaOpts.tsp @@ -1,6 +1,11 @@ @doc("Options for Conda environments.") +@example(#{ + basePackages: "python=3.8", + commands: #["pip install bwa", "pip install salmon"], + mambaImage: "mambaorg/micromamba:0.15.3" +}) model CondaOpts { basePackages: string; commands: string[]; mambaImage: string; -} \ No newline at end of file +} diff --git a/typespec/models/Packages.tsp b/typespec/models/CondaPackages.tsp similarity index 78% rename from typespec/models/Packages.tsp rename to typespec/models/CondaPackages.tsp index ce534501b..64f84cfdd 100644 --- a/typespec/models/Packages.tsp +++ b/typespec/models/CondaPackages.tsp @@ -1,10 +1,10 @@ import "./CondaOpts.tsp"; @doc("Package configurations for container builds.") -model Packages { +model CondaPackages { channels: string[]; condaOpts?: CondaOpts; entries: string[]; - environment: string; + environment?: string; type: "CONDA"; } diff --git a/typespec/models/ContainerConfig.tsp b/typespec/models/ContainerConfig.tsp index 834297775..c6f37df50 100644 --- a/typespec/models/ContainerConfig.tsp +++ b/typespec/models/ContainerConfig.tsp @@ -1,6 +1,21 @@ import "./ContainerLayer.tsp"; @doc("Configuration details for a container.") +@example(#{ + cmd: #["echo", "hello"], + entrypoint: #["/bin/sh"], + env: #["FOO=bar"], + layers: #[ + #{ + gzipDigest: "sha256:1234567890abcdef", + gzipSize: "1234", + location: "https://seqera.io/layer.tar.gz", + skipHashing: false, + tarDigest: "sha256:abcdef1234567890" + } + ], + workingDir: "/app" +}) model ContainerConfig { cmd: string[]; entrypoint: string[]; diff --git a/typespec/models/ContainerInspectConfig.tsp b/typespec/models/ContainerInspectConfig.tsp index bf59c40e9..49d64d762 100644 --- a/typespec/models/ContainerInspectConfig.tsp +++ b/typespec/models/ContainerInspectConfig.tsp @@ -1,7 +1,25 @@ import "./RootFS.tsp"; @doc("Configuration details of a container.") -model Config { +@example(#{ + architecture: "linux/amd64", + config: #{ + attachStdin: false, + attachStdout: true, + attachStderr: true, + tty: false, + env: #["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"], + cmd: #["sh"], + image: "alpine:latest" + }, + container: "docker.io/alpine:latest", + created: "2021-06-10T15:00:00.000000000Z", + rootfs: #{ + diff_ids: #["sha256:1234567890abcdef"], + type: "layers" + } +}) +model ContainerInspectConfig { architecture: string; config: { attachStdin: boolean; @@ -15,4 +33,4 @@ model Config { container: string; created: string; rootfs: RootFS; -} \ No newline at end of file +} diff --git a/typespec/models/ContainerInspectRequest.tsp b/typespec/models/ContainerInspectRequest.tsp index 00e2dd23e..eec0962b5 100644 --- a/typespec/models/ContainerInspectRequest.tsp +++ b/typespec/models/ContainerInspectRequest.tsp @@ -1,7 +1,13 @@ @doc("Request payload for inspecting a container.") +@example(#{ + containerImage: "docker.io/alpine:latest", + towerAccessToken: "1234567890abcdef", + towerEndpoint: "https://api.cloud.seqera.io", + towerWorkspaceId: 1234567890 +}) model ContainerInspectRequest { containerImage: string; towerAccessToken: string; towerEndpoint: string; towerWorkspaceId: int64; -} \ No newline at end of file +} diff --git a/typespec/models/ContainerInspectResponse.tsp b/typespec/models/ContainerInspectResponse.tsp index 6aee1cb04..6ac0c3b26 100644 --- a/typespec/models/ContainerInspectResponse.tsp +++ b/typespec/models/ContainerInspectResponse.tsp @@ -2,6 +2,52 @@ import "./ContainerInspectConfig.tsp"; import "./Manifest.tsp"; @doc("Response payload for inspecting a container.") +@example(#{ + Container: #{ + registry: "docker.io", + hostName: "docker.io", + imageName: "alpine", + reference: "latest", + digest: "sha256:1234567890abcdef", + config: #{ + architecture: "linux/amd64", + config: #{ + attachStdin: false, + attachStdout: true, + attachStderr: true, + tty: false, + env: #["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"], + cmd: #["sh"], + image: "alpine:latest" + }, + container: "docker.io/alpine:latest", + created: "2021-06-10T15:00:00.000000000Z", + rootfs: #{ + diff_ids: #["sha256:1234567890abcdef"], + type: "layers" + } + }, + manifest: #{ + schemaVersion: 2, + mediaType: "application/vnd.docker.distribution.manifest.v2+json", + config: #{ + mediaType: "application/vnd.docker.container.image.v1+json", + size: 123456, + digest: "sha256:1234567890abcdef" + }, + layers: #[ + #{ + mediaType: "application/vnd.docker.image.rootfs.diff.tar.gzip", + size: 123456, + digest: "sha256:1234567890abcdef" + } + ] + }, + v1: false, + v2: true, + oci: false + } +}) model ContainerInspectResponse { Container: { registry: string; @@ -9,7 +55,7 @@ model ContainerInspectResponse { imageName: string; reference: string; digest: string; - config: Config; + config: ContainerInspectConfig; manifest: Manifest; v1: boolean; v2: boolean; diff --git a/typespec/models/ContainerLayer.tsp b/typespec/models/ContainerLayer.tsp index 873cb4c84..2c57e8bdc 100644 --- a/typespec/models/ContainerLayer.tsp +++ b/typespec/models/ContainerLayer.tsp @@ -1,4 +1,11 @@ @doc("Represents a layer in a container image.") +@example(#{ + gzipDigest: "sha256:1234567890abcdef", + gzipSize: "123456", + location: "https://example.com/image.tar.gz", + skipHashing: false, + tarDigest: "sha256:abcdef1234567890" +}) model ContainerLayer { gzipDigest: string; gzipSize: string; diff --git a/typespec/models/ContainerMirrorResponse.tsp b/typespec/models/ContainerMirrorResponse.tsp index 419575b9d..06cb95221 100644 --- a/typespec/models/ContainerMirrorResponse.tsp +++ b/typespec/models/ContainerMirrorResponse.tsp @@ -2,6 +2,22 @@ import "./ContainerPlatform.tsp"; import "./Status.tsp"; @doc("Response payload for container mirroring.") +@example(#{ + mirrorId: "6c084f2e43f86a78_1", + digest: "sha256:1234567890abcdef", + sourceImage: "docker.io/alpine:latest", + targetImage: "docker.io/alpine:latest", + platform: #{ + os: "LINUX", + arch: "AMD64", + variant: "v1" + }, + creationTime: "2024-04-09T20:31:35.355423Z", + status: Status.COMPLETED, + duration: "123.914989000", + exitCode: 0, + logs: "Successfully mirrored image." +}) model ContainerMirrorResponse { mirrorId: string; digest: string; diff --git a/typespec/models/ContainerPlatform.tsp b/typespec/models/ContainerPlatform.tsp index 67da1a2f6..6e1e6ce77 100644 --- a/typespec/models/ContainerPlatform.tsp +++ b/typespec/models/ContainerPlatform.tsp @@ -1,4 +1,9 @@ @doc("Represents os platform of a container.") +@example(#{ + os: "linux", + arch: "amd64", + variant: "v1" +}) model ContainerPlatform { os: string; arch: string; diff --git a/typespec/models/ContainerRequest.tsp b/typespec/models/ContainerRequest.tsp index 38c4ef56a..ddaa28d49 100644 --- a/typespec/models/ContainerRequest.tsp +++ b/typespec/models/ContainerRequest.tsp @@ -1,31 +1,40 @@ import "./ContainerConfig.tsp"; -import "./Packages.tsp"; +import "./CondaPackages.tsp"; import "./ScanMode.tsp"; import "./ScanLevel.tsp"; @doc("Request payload for creating a container token.") +@example(#{ + packages:#{ + type: "CONDA", + entries: #["salmon", "bwa"], + channels: #["conda-forge", "bioconda"] + }, + format: "docker", + containerPlatform:"linux/amd64" +}) model ContainerRequest { - buildContext: ContainerLayer; + buildContext?: ContainerLayer; buildRepository?: string; cacheRepository?: string; - containerConfig: ContainerConfig; + containerConfig?: ContainerConfig; containerFile?: string; - containerImage: string; - containerIncludes: string[]; + containerImage?: string; + containerIncludes?: string[]; containerPlatform: string; - dryRun: boolean; + dryRun?: boolean; fingerprint?: string; format: "sif" | "docker"; freeze?: boolean; nameStrategy?: "none" | "tagPrefix" | "imageSuffix"; mirror?: boolean; - packages?: Packages; + packages?: CondaPackages; scanMode?: ScanMode; scanLevels?: ScanLevel[]; - timestamp: string; + timestamp?: string; towerAccessToken?: string; towerEndpoint?: string; towerRefreshToken?: string; towerWorkspaceId?: int32; - workflowId: string; + workflowId?: string; } diff --git a/typespec/models/ContainerResponse.tsp b/typespec/models/ContainerResponse.tsp index 3d8c83865..a6de42987 100644 --- a/typespec/models/ContainerResponse.tsp +++ b/typespec/models/ContainerResponse.tsp @@ -1,6 +1,19 @@ import "./ContainerStatus.tsp"; @doc("Response payload for container token creation.") +@example(#{ + containerToken:"732b73aa17c8", + targetImage:"wave.seqera.io/wt/732b73aa17c8/build/dev:salmon_bwa--5e49881e6ad74121", + expiration:"2024-04-09T21:19:01.715321Z", + buildId:"5e49881e6ad74121_1", + cached:false, + freeze:false, + mirror:false, + requestId:"5e49881e6ad74121", + scanId:"5e49881e6ad74121", + containerImage:"docker.io/build/dev:salmon_bwa--5e49881e6ad74121", + status:ContainerStatus.PENDING + }) model ContainerResponse { buildId: string; cached: boolean; diff --git a/typespec/models/ContainerStatusResponse.tsp b/typespec/models/ContainerStatusResponse.tsp index 93d775d62..d7701338f 100644 --- a/typespec/models/ContainerStatusResponse.tsp +++ b/typespec/models/ContainerStatusResponse.tsp @@ -1,15 +1,25 @@ import "./ContainerStatus.tsp"; @doc("Response payload for container status.") +@example(#{ + id:"6c084f2e43f86a78", + buildId:"6c084f2e43f86a78_1", + status:ContainerStatus.DONE, + creationTime:"2024-04-09T20:31:35.355423Z", + detailsUri:"https://wave.seqera.io/view/builds/6c084f2e43f86a78_1", + duration:"123.914989000", + succeeded:true, + scanId:"6c084f2e43f86a78_1", +}) model ContainerStatusResponse { id: string; status: ContainerStatus; buildId: string; - mirrorId: string; + mirrorId?: string; scanId: string; - vulnerabilities: Record; + vulnerabilities?: Record; succeeded: boolean; - reason: string; + reason?: string; detailsUri: string; creationTime: string; duration: string; diff --git a/typespec/models/Manifest.tsp b/typespec/models/Manifest.tsp index 60f93bcc2..0906b90da 100644 --- a/typespec/models/Manifest.tsp +++ b/typespec/models/Manifest.tsp @@ -1,6 +1,22 @@ import "./ManifestLayer.tsp"; @doc("Manifest details of a container.") +@example(#{ + config: #{ + digest: "sha256:6c084f2e43f86a78", + mediaType: "application/vnd.docker.container.image.v1+json", + size: 1234 + }, + layers: #[ + #{ + digest: "sha256:6c084f2e43f86a78", + mediaType: "application/vnd.docker.container.image.v1+json", + size: 1234 + } + ], + mediaType: "application/vnd.docker.container.image.v1+json", + schemaVersion: 2 +}) model Manifest { config: { digest: string; @@ -10,4 +26,4 @@ model Manifest { layers: ManifestLayer[]; mediaType: string; schemaVersion: int32; -} \ No newline at end of file +} diff --git a/typespec/models/ManifestLayer.tsp b/typespec/models/ManifestLayer.tsp index 418904eb9..d3d24eb66 100644 --- a/typespec/models/ManifestLayer.tsp +++ b/typespec/models/ManifestLayer.tsp @@ -1,6 +1,11 @@ @doc("Manifest layer details of a container.") +@example(#{ + digest: "sha256:6c084f2e43f86a78", + mediaType: "application/vnd.docker.container.image.v1+json", + size: 1234 +}) model ManifestLayer { digest: string; mediaType: string; size: int64; -} \ No newline at end of file +} diff --git a/typespec/models/RootFS.tsp b/typespec/models/RootFS.tsp index 2ec6be063..ebb4d8a73 100644 --- a/typespec/models/RootFS.tsp +++ b/typespec/models/RootFS.tsp @@ -1,4 +1,11 @@ @doc("Details about the root filesystem of a container.") +@example(#{ + diff_ids: #[ + "sha256:6c084f2e43f86a78", + "sha256:6c084f2e43f86a78" + ], + type: "layers" +}) model RootFS { diff_ids: string[]; type: string; diff --git a/typespec/models/User.tsp b/typespec/models/User.tsp index 883494f13..14ad84809 100644 --- a/typespec/models/User.tsp +++ b/typespec/models/User.tsp @@ -1,4 +1,9 @@ @doc("Wave USer details") +@example(#{ + id: 1, + userName: "test", + email: "test@seqera.io" + }) model User { id: int64; userName: string; diff --git a/typespec/models/ValidateRegistryCredsRequest.tsp b/typespec/models/ValidateRegistryCredsRequest.tsp index c1ef4ba95..7fe0049d2 100644 --- a/typespec/models/ValidateRegistryCredsRequest.tsp +++ b/typespec/models/ValidateRegistryCredsRequest.tsp @@ -1,7 +1,11 @@ @doc("request payload of validate credentials request") +@example(#{ + password: "password", + registry: "docker.io/wave", + userName: "username" +}) model ValidateRegistryCredsRequest { password: string; registry: string; userName: string; } - \ No newline at end of file diff --git a/typespec/models/Vulnerability.tsp b/typespec/models/Vulnerability.tsp index 9a4e5339c..59cd5d899 100644 --- a/typespec/models/Vulnerability.tsp +++ b/typespec/models/Vulnerability.tsp @@ -1,4 +1,13 @@ @doc("Scan Vulnerability details") +@example(#{ + fixedVersion: "1.0.0", + id: "CVE-2021-1234", + installedVersion: "0.9.0", + pkgName: "test", + primaryUrl: "https://test.com", + severity: "high", + title: "test" +}) model Vulnerability { fixedVersion: string; id: string; @@ -7,4 +16,4 @@ model Vulnerability { primaryUrl: string; severity: string; title: string; - } \ No newline at end of file + } diff --git a/typespec/models/WaveBuildRecord.tsp b/typespec/models/WaveBuildRecord.tsp index 50f6966d1..4c4bc6069 100644 --- a/typespec/models/WaveBuildRecord.tsp +++ b/typespec/models/WaveBuildRecord.tsp @@ -1,3 +1,4 @@ +@doc("Wave container build details") model WaveBuildRecord { buildId: string; condaFile: string; From e8f2883ab72d563c851683eeeea707612f10f074 Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Wed, 26 Feb 2025 15:33:57 +0100 Subject: [PATCH 3/3] added field docs Signed-off-by: munishchouhan --- typespec/models/CondaOpts.tsp | 3 +++ typespec/models/CondaPackages.tsp | 4 ++++ typespec/models/ContainerConfig.tsp | 4 ++++ typespec/models/ContainerInspectRequest.tsp | 4 ++++ typespec/models/ContainerLayer.tsp | 5 +++++ typespec/models/ContainerRequest.tsp | 20 +++++++++++++++++++- typespec/models/ContainerResponse.tsp | 11 +++++++++++ 7 files changed, 50 insertions(+), 1 deletion(-) diff --git a/typespec/models/CondaOpts.tsp b/typespec/models/CondaOpts.tsp index 38c16ed0a..3d2165512 100644 --- a/typespec/models/CondaOpts.tsp +++ b/typespec/models/CondaOpts.tsp @@ -5,7 +5,10 @@ mambaImage: "mambaorg/micromamba:0.15.3" }) model CondaOpts { + @doc("Names of base packages.") basePackages: string; + @doc("Command to be included in the container.") commands: string[]; + @doc("Name of the docker image used to build Conda containers.") mambaImage: string; } diff --git a/typespec/models/CondaPackages.tsp b/typespec/models/CondaPackages.tsp index 64f84cfdd..09f589449 100644 --- a/typespec/models/CondaPackages.tsp +++ b/typespec/models/CondaPackages.tsp @@ -2,9 +2,13 @@ import "./CondaOpts.tsp"; @doc("Package configurations for container builds.") model CondaPackages { + @doc("Conda channels to search for packages.") channels: string[]; condaOpts?: CondaOpts; + @doc("Conda packages to install.") entries: string[]; + @doc("The package environment file encoded as a base64 string.") environment?: string; + @doc("This represents the type of package builder. Use `CONDA`.") type: "CONDA"; } diff --git a/typespec/models/ContainerConfig.tsp b/typespec/models/ContainerConfig.tsp index c6f37df50..ea46e0744 100644 --- a/typespec/models/ContainerConfig.tsp +++ b/typespec/models/ContainerConfig.tsp @@ -17,9 +17,13 @@ import "./ContainerLayer.tsp"; workingDir: "/app" }) model ContainerConfig { + @doc("The launch command to be used by the Wave container, e.g., `['echo', 'Hello world']` (optional).") cmd: string[]; + @doc("The container entrypoint command, e.g., `['/bin/bash']`.") entrypoint: string[]; + @doc("The environment variables to be defined in the Wave container, e.g., `['FOO=one','BAR=two']` (optional).") env: string[]; layers: ContainerLayer[]; + @doc("The work directory to be used in the Wave container, e.g., `/some/work/dir` (optional).") workingDir: string; } diff --git a/typespec/models/ContainerInspectRequest.tsp b/typespec/models/ContainerInspectRequest.tsp index eec0962b5..125d57b15 100644 --- a/typespec/models/ContainerInspectRequest.tsp +++ b/typespec/models/ContainerInspectRequest.tsp @@ -6,8 +6,12 @@ towerWorkspaceId: 1234567890 }) model ContainerInspectRequest { + @doc("Name of the container to be inpected, e.g., `docker.io/library/ubuntu:latest`") containerImage: string; + @doc("Access token of the user account granting the access to the Seqera Platform service specified via `towerEndpoint` (optional). ") towerAccessToken: string; + @doc("Seqera Platform service endpoint from where container registry credentials are retrieved (optional). Default `https://api.cloud.seqera.io`. ") towerEndpoint: string; + @doc("ID of the Seqera Platform workspace from where the container registry credentials are retrieved (optional). When omitted the personal workspace is used.") towerWorkspaceId: int64; } diff --git a/typespec/models/ContainerLayer.tsp b/typespec/models/ContainerLayer.tsp index 2c57e8bdc..5d3f1354b 100644 --- a/typespec/models/ContainerLayer.tsp +++ b/typespec/models/ContainerLayer.tsp @@ -7,9 +7,14 @@ tarDigest: "sha256:abcdef1234567890" }) model ContainerLayer { + @doc("The SHA256 checksum of the provided layer tar gzip file, e.g., `sha256:a7c724b02...`.") gzipDigest: string; + @doc("The size in bytes of the the provided layer tar gzip file.") gzipSize: string; + @doc("Specifies a container image layer stored as a tar.gz file (optional). Either a HTTP URL to the file or a base64 encoded string prefixed with `data:`.") location: string; + @doc("If true, the layer tar file will not be hashed.") skipHashing: boolean; + @doc("The SHA256checksum of the provided tar file, e.g., `sha256:a7c724b02...`.") tarDigest: string; } diff --git a/typespec/models/ContainerRequest.tsp b/typespec/models/ContainerRequest.tsp index ddaa28d49..c4973d2f5 100644 --- a/typespec/models/ContainerRequest.tsp +++ b/typespec/models/ContainerRequest.tsp @@ -15,26 +15,44 @@ import "./ScanLevel.tsp"; }) model ContainerRequest { buildContext?: ContainerLayer; + @doc("Container repository where container builds should be pushed, e.g., `docker.io/user/my-image` (optional).") buildRepository?: string; + @doc("Container repository used to cache build layers `docker.io/user/my-cache` (optional).") cacheRepository?: string; containerConfig?: ContainerConfig; + @doc("Dockerfile used for building a new container encoded in base64 (optional). When provided, the attribute `containerImage` must be omitted.") containerFile?: string; + @doc("Name of the container to be served, e.g., `docker.io/library/ubuntu:latest` (optional). If omitted, the `containerFile` must be provided. ") containerImage?: string; + @doc("List of container images to include in the built container (optional).") containerIncludes?: string[]; + @doc("Target container architecture of the built container, e.g., `linux/amd64` (optional). Currently only supporting amd64 and arm64.") containerPlatform: string; + @doc("Request to build the container in a dry-run mode.") dryRun?: boolean; + @doc("Request unique fingerprint.") fingerprint?: string; + @doc("The format of the container to be built. Its values can be `sif` for singularity or `docker` as default. ") format: "sif" | "docker"; + @doc("Freeze requires buildRepository to push the build container to a user-defined repository. This provides the container URL from the user-defined repository, not the Wave generated URL. This URL won't change.") freeze?: boolean; + @doc("The name strategy to be used to create the name of the container built by Wave. Its values can be `none`, `tagPrefix`, or `imageSuffix`. ") nameStrategy?: "none" | "tagPrefix" | "imageSuffix"; mirror?: boolean; + @doc("Conda packages to be installed in the container.") packages?: CondaPackages; scanMode?: ScanMode; scanLevels?: ScanLevel[]; + @doc("Request submission timestamp using ISO-8601.") timestamp?: string; + @doc("Access token of the user account granting access to the Seqera Platform service specified via `towerEndpoint` (optional).") towerAccessToken?: string; + @doc("Seqera Platform service endpoint from where container registry credentials are retrieved (optional). Default `https://api.cloud.seqera.io`.") towerEndpoint?: string; + @doc("Token to refresh ``towerAccessToken` after it become invalid (optional).") towerRefreshToken?: string; - towerWorkspaceId?: int32; + @doc("ID of the Seqera Platform workspace from where the container registry credentials are retrieved (optional). When omitted the personal workspace is used.") + towerWorkspaceId?: int64; + @doc("ID of the Seqera Platform workspace from which this container request originates (optional).") workflowId?: string; } diff --git a/typespec/models/ContainerResponse.tsp b/typespec/models/ContainerResponse.tsp index a6de42987..0867abea5 100644 --- a/typespec/models/ContainerResponse.tsp +++ b/typespec/models/ContainerResponse.tsp @@ -15,15 +15,26 @@ import "./ContainerStatus.tsp"; status:ContainerStatus.PENDING }) model ContainerResponse { + @doc("Unique identifier for the build.") buildId: string; + @doc("Indicates if the build is cached.") cached: boolean; + @doc("Container image to be used.") containerImage: string; + @doc("Token to access the container.") containerToken: string; + @doc("The expiration timestamp of the Wave container using ISO-8601 format.") expiration: string; + @doc("Indicates if the build is pushed to user container registry.") freeze: boolean; + @doc("Indicates if its a mirror request.") mirror: boolean; + @doc("Unique identifier for the request.") requestId: string; + @doc("Unique identifier for the scan.") scanId: string; + @doc("Status of the container build.") status: ContainerStatus; + @doc("The Wave container image name") targetImage: string; }