Skip to content

Commit

Permalink
Merge branch 'master' into 172-add-support-for-conda-lock-file
Browse files Browse the repository at this point in the history
  • Loading branch information
munishchouhan committed Sep 24, 2024
2 parents 0d0b8d7 + 2f5a1fe commit fea3891
Show file tree
Hide file tree
Showing 96 changed files with 3,003 additions and 1,791 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ images.
* Augment container images i.e. dynamically add one or more container layers to existing images;
* Build container images on-demand for a given container file (aka Dockerfile);
* Build container images on-demand based on one or more Conda packages;
* Build container images on-demand based on one or more Spack packages, Spack support will be removed in future releases;
* Build container images for a specified target platform (currently linux/amd64 and linux/arm64);
* Push and cache built containers to a user-provided container repository;
* Build Singularity native containers both using a Singularity spec file, Conda package(s) and Spack package(s);
* Build Singularity native containers both using a Singularity spec file, Conda package(s);
* Push Singularity native container images to OCI-compliant registries;


Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.12.2
1.12.3
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies {
compileOnly("io.micronaut:micronaut-http-validation")
implementation("jakarta.persistence:jakarta.persistence-api:3.0.0")
api 'io.seqera:lib-mail:1.0.0'
api 'io.seqera:wave-api:0.10.0'
api 'io.seqera:wave-api:0.12.0'
api 'io.seqera:wave-utils:0.13.1'

implementation("io.micronaut:micronaut-http-client")
Expand Down
8 changes: 6 additions & 2 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Wave changelog
1.12.3 - 22 Sep 2024
- Fix build status completion of submit exception [3c3af360]
- Fix singularity build mounts [3b338b29]

1.12.2 - 18 Sep 2024
- Fix Remove entries permanently from stream once consumed [adfad9d6]
- Refactor container build service [1a858c12]
Expand All @@ -13,7 +17,7 @@
- Do not retry on build failure (#632) [e6568d1e]
- Fix Blob cache failure duration (#643) [ebf65adc]
- Fix K8s job status detection (#630) [d5b45d8d] [7a9046ed] [e26811dd]
- Fix Retry policy delay multipler (#629) [80037565]
- Fix Retry policy delay multiplier (#629) [80037565]
- Improve blob cache info (#644) [8b96173a]
- Improve blob cache logging [e4c75671]
- Improve blob cache reliability (#596) [dfb64bad]
Expand All @@ -33,7 +37,7 @@
- Add /v1alpha2/container/{token} in typespec (#618) [5cbd67a8]
- Fix failing type checks [bd704bea]
- Fix too many requests error code (#610) [ec43fa0d]
- Increase blob cache timeout to 10m and decrese status to 1h [cf4b7588]
- Increase blob cache timeout to 10m and decrease status to 1h [cf4b7588]
- Improve container view page (#615) [d9b8cab8]
- Improve registry auth error handling (#628) [c9185730]
- Increase cache-tower-client to 1min (#641) [df32b305]
Expand Down
14 changes: 0 additions & 14 deletions configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,6 @@ Below are the standard format for known registries, but you can change registry

- **`wave.build.force-compression`**: determines whether to force the compression for each cache layers produced by the build process. The default is `false`, enabling compression for more efficient storage. *Optional*.

### Spack configuration for wave build process

**Note**: Spack support will be removed in future releases.

Spack configuration consists of the path of its secret file, the mount path for the secret file in the spack container, and the optional S3 bucket name for the spack binary cache.

**Note**: these configuration are mandatory to support Spack in a wave installation.

- **`wave.build.spack.secretKeyFile`**: the path to the file containing the PGP private key used to [sign Spack packages built by Wave](https://spack.readthedocs.io/en/latest/binary_caches.html#build-cache-signing). For example, `/efs/wave/spack/key`*Mandatory*.

- **`wave.build.spack.secretMountPath`**: sets the mount path inside the Spack Docker image for the PGP private key specified by `wave.build.spack.secretKeyFile`. For instance `/var/seqera/spack/key`. Indicating where the PGP private key should be mounted inside the Spack Docker image. *Mandatory*.

- **`wave.build.spack.cacheBucket`**: specifies the S3 bucket for the Spack binary cache, for example, `s3://spack-binarycache`*Optional*.

### Build process logs configuration

This configuration specifies attributes for the persistence of the logs fetched from containers or k8s pods used for building requested images, which can be accessed later and also attached to the build completion email.
Expand Down
8 changes: 0 additions & 8 deletions docs/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ This API endpoint is deprecated in current versions of Wave.
]
},
condaFile: string,
spackFile: string,
containerPlatform: string,
buildRepository: string,
cacheRepository: string,
Expand Down Expand Up @@ -81,7 +80,6 @@ This API endpoint is deprecated in current versions of Wave.
| `containerConfig.layers.gzipSize` | The size in bytes of the the provided layer tar gzip file. |
| `containerFile` | Dockerfile used for building a new container encoded in base64 (optional). When provided, the attribute `containerImage` must be omitted. |
| `condaFile` | Conda environment file encoded as base64 string. |
| `spackFile` | `Deprecated` Spack recipe file encoded as base64 string. Spack support will be removed in future releases. |
| `containerPlatform` | Target container architecture of the built container, e.g., `linux/amd64` (optional). Currently only supporting amd64 and arm64. |
| `buildRepository` | Container repository where container builds should be pushed, e.g., `docker.io/user/my-image` (optional). |
| `cacheRepository` | Container repository used to cache build layers `docker.io/user/my-cache` (optional). |
Expand Down Expand Up @@ -136,7 +134,6 @@ The endpoint returns the name of the container request made available by Wave.
]
},
condaFile: string,
spackFile: string,
containerPlatform: string,
buildRepository: string,
cacheRepository: string,
Expand All @@ -157,10 +154,6 @@ The endpoint returns the name of the container request made available by Wave.
commands: string[],
basePackages: string
}
spackOpts:{
commands: string[],
basePackages: string
}

},
nameStrategy: string
Expand All @@ -182,7 +175,6 @@ The endpoint returns the name of the container request made available by Wave.
| `containerConfig.layers.gzipSize` | The size in bytes of the the provided layer tar gzip file. |
| `containerFile` | Dockerfile used for building a new container encoded in base64 (optional). When provided, the attribute `containerImage` must be omitted. |
| `condaFile` | Conda environment file encoded as base64 string. |
| `spackFile` | `Deprecated` Spack recipe file encoded as base64 string. Spack support will be removed in future releases. |
| `containerPlatform` | Target container architecture of the built container, e.g., `linux/amd64` (optional). Currently only supporting amd64 and arm64. |
| `buildRepository` | Container repository where container builds should be pushed, e.g., `docker.io/user/my-image` (optional). |
| `cacheRepository` | Container repository used to cache build layers `docker.io/user/my-cache` (optional). |
Expand Down
99 changes: 0 additions & 99 deletions src/main/groovy/io/seqera/wave/configuration/SpackConfig.groovy

This file was deleted.

32 changes: 27 additions & 5 deletions src/main/groovy/io/seqera/wave/controller/BuildController.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ import io.micronaut.http.server.types.files.StreamedFile
import io.micronaut.scheduling.TaskExecutors
import io.micronaut.scheduling.annotation.ExecuteOn
import io.seqera.wave.api.BuildStatusResponse
import io.seqera.wave.exception.BadRequestException
import io.seqera.wave.service.builder.ContainerBuildService
import io.seqera.wave.service.conda.CondaLockService
import io.seqera.wave.service.logs.BuildLogService
import io.seqera.wave.service.mirror.ContainerMirrorService
import io.seqera.wave.service.mirror.MirrorRequest
import io.seqera.wave.service.persistence.WaveBuildRecord
import jakarta.inject.Inject
/**
Expand All @@ -50,6 +53,9 @@ class BuildController {
@Inject
private ContainerBuildService buildService

@Inject
private ContainerMirrorService mirrorService

@Inject
@Nullable
BuildLogService logService
Expand All @@ -58,7 +64,7 @@ class BuildController {
CondaLockService condaLockService

@Get("/v1alpha1/builds/{buildId}")
HttpResponse<WaveBuildRecord> getBuildRecord(String buildId){
HttpResponse<WaveBuildRecord> getBuildRecord(String buildId) {
final record = buildService.getBuildRecord(buildId)
return record
? HttpResponse.ok(record)
Expand All @@ -77,10 +83,10 @@ class BuildController {
}

@Get("/v1alpha1/builds/{buildId}/status")
HttpResponse<BuildStatusResponse> getBuildStatus(String buildId){
final build = buildService.getBuildRecord(buildId)
build != null
? HttpResponse.ok(build.toStatusResponse())
HttpResponse<BuildStatusResponse> getBuildStatus(String buildId) {
final resp = buildResponse0(buildId)
resp != null
? HttpResponse.ok(resp)
: HttpResponse.<BuildStatusResponse>notFound()
}

Expand All @@ -96,4 +102,20 @@ class BuildController {
: HttpResponse.<StreamedFile>notFound()
}

protected BuildStatusResponse buildResponse0(String buildId) {
if( !buildId )
throw new BadRequestException("Missing 'buildId' parameter")
// build IDs starting with the `mr-` prefix are interpreted as mirror requests
if( buildId.startsWith(MirrorRequest.ID_PREFIX) ) {
return mirrorService
.getMirrorState(buildId)
?.toStatusResponse()
}
else {
return buildService
.getBuildRecord(buildId)
?.toStatusResponse()
}
}

}
Loading

0 comments on commit fea3891

Please sign in to comment.