Skip to content

Commit 6ac88fe

Browse files
Merge branch 'master' into replace-efs-with-objectstore
2 parents e3deddf + 69062b2 commit 6ac88fe

7 files changed

Lines changed: 122 additions & 41 deletions

File tree

config.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,4 @@ wave:
1111
195996028523.dkr.ecr.eu-west-1.amazonaws.com:
1212
username : "${AWS_ACCESS_KEY_ID:}"
1313
password : "${AWS_SECRET_ACCESS_KEY:}"
14-
seqeralabs.azurecr.io:
15-
username : "${AZURECR_USER:}"
16-
password : "${AZURECR_PAT:}"
1714
...

docs/configuration.mdx

Lines changed: 51 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Wave Application Configuration
1+
# Wave application configuration
22

3-
Set Wave configuration values using environment variables or in [`config.yml`](https://github.com/seqeralabs/wave/blob/master/config.yml) configuration file
3+
Set Wave configuration values using environment variables or in the [`config.yml`](https://github.com/seqeralabs/wave/blob/master/config.yml) configuration file.
44

55
### config.yml configuration
66

@@ -16,15 +16,15 @@ Environment variables for various attributes has been listed in third column, ei
1616

1717
## General configuration
1818

19-
General configuration options such as wave application name, port, whether to allow anonymous access (without tower token), wave and Seqera platform url.
19+
General configuration options such as Wave application name, port, whether to allow anonymous access (without tower token), Wave and Seqera platform url.
2020

2121
- **`micronaut.application.name`**: the name of the Wave application. By default, it is set to `wave-app`*Optional*.
2222

2323
- **`micronaut.server.port`**: the port used by the Wave server. The default port is `8080`*Optional*.
2424

25-
- **`wave.allowAnonymous`**: specifies whether anonymous access to the Wave server is permitted. By default, it is set to `false`, meaning authentication is required. Change this option based on your security requirements. *Mandatory*.
25+
- **`wave.allowAnonymous`**: specifies whether anonymous access to the Wave server is permitted. By default, it is set to `false`, meaning authentication is required. Change this option based on your security requirements.  *Mandatory*.
2626

27-
- **`wave.server.url`**: the URL for the Wave server. You can also set it using `${WAVE_SERVER_URL}` environment variable. *Optional*.
27+
- **`wave.server.url`**: the URL for the Wave server. It can be set using `${WAVE_SERVER_URL}` environment variable. *Optional*.
2828

2929
- **`wave.tokens.cache.duration`**: the duration for cached tokens generated by Wave. The default is `1h`, and you can modify it according to your token caching preferences. *Optional*.
3030

@@ -36,10 +36,13 @@ General configuration options such as wave application name, port, whether to al
3636
## Container registry configuration
3737

3838
The generic format for the attributes is `wave.registries.<registry_name>.username` and `wave.registries.<registry_name>.password`.
39-
You need to specify all the repositories you will use in the respective wave installation.
39+
You need to specify all the repositories you will use in the respective Wave installation.
4040
Below are the standard format for known registries, but you can change registry name `(azurecr.io)` to specific one like `seqeralabs.azurecr.io `.
4141

42-
**Note**: Container registry credentials can be defined in [`config.yml`](https://github.com/seqeralabs/wave/blob/master/config.yml) too. These configurations are important for the wave authentication to the repositories used to push or pull artifacts.
42+
:::note
43+
Container registry credentials can be defined in [`config.yml`](https://github.com/seqeralabs/wave/blob/master/config.yml) too.
44+
These configurations are important for the Wave authentication to the repositories used to push or pull artifacts.
45+
:::
4346

4447
- **`wave.registries.default`**: the default Docker registry for Wave. The default is `docker.io`, and it represents the Docker Hub. *Optional*.
4548

@@ -55,10 +58,6 @@ Below are the standard format for known registries, but you can change registry
5558

5659
- **`wave.registries.<AWS ECR Repo name>.password`**: the AWS ECR password for authentication. An example AWS ECR Repo name is `195996028523.dkr.ecr.eu-west-1.amazonaws.com`. It can be set using `${AWS_SECRET_ACCESS_KEY}` environment variable. *Optional*.
5760

58-
- **`wave.registries.<azurecr Repo name>.username`**: the Azure Container Registry username for authentication. An example of an Azure Container Registry Repo name is `seqeralabs.azurecr.io`. It can be set using `${AZURECR_USER}` environment variable. *Optional*.
59-
60-
- **`wave.registries.<azurecr Repo name>.password`**: the Azure Container Registry password or PAT for authentication. An example of an Azure Container Registry Repo name is `seqeralabs.azurecr.io`. It can be set using `${AZURECR_PAT}` environment variable. *Optional*.
61-
6261
## HTTP client configuration
6362

6463
- **`wave.httpclient.connectTimeout`**: sets the connection timeout for the HTTP client. Its default value is `20s`*Optional*.
@@ -73,7 +72,7 @@ Below are the standard format for known registries, but you can change registry
7372

7473
- **`wave.httpclient.retry.multiplier`**: defines the multiplier for HTTP client retries. Its default value is `1.0`*Optional*.
7574

76-
- **`micronaut.http.services.stream-client.read-timeout`**: sets the read timeout for the streaming HTTP client. Its default value is `30s`*Optional*.
75+
- **`micronaut.http.services.stream-client.read-timeout`**: sets the read timeout for the streaming HTTP client. Its default value is `30s`.  *Optional*.
7776

7877
- **`micronaut.http.services.stream-client.read-idle-timeout`**: configures the read idle timeout for the streaming HTTP client. Its default value is `120s`*Optional*.
7978

@@ -93,15 +92,15 @@ Below are the standard format for known registries, but you can change registry
9392

9493
- **`wave.build.repo`**: specifies the Docker container repository for the Docker images built by Wave. This setting is required to define where the images will be stored. *Mandatory*.
9594

96-
- **`wave.build.cache`**: determines the Docker container repository used to cache layers of images built by Wave. *Mandatory*.
95+
- **`wave.build.cache`**: determines the Docker container repository used to cache layers of images built by Wave.  *Mandatory*.
9796

98-
- **`wave.build.status.delay`**: sets the delay between build status checks. Its default value is `5s`, providing a reasonable interval for status checks. *Optional*.
97+
- **`wave.build.status.delay`**: sets the delay between build status checks. Its default value is `5s`, providing a reasonable interval for status checks.  *Optional*.
9998

100-
- **`wave.build.status.duration`**: defines the duration for build status checks. Its default value is `1d` (1 day), indicating how long the system should check the build status. *Optional*.
99+
- **`wave.build.status.duration`**: defines the duration for build status checks. Its default value is `1d` (1 day), indicating how long the system should check the build status.  *Optional*.
101100

102101
- **`wave.build.public`**: indicates whether the Docker container repository is public. If set to true, Wave freeze will prefer this public repository over `wave.build.repo`*Optional*.
103102

104-
- **`wave.build.oci-mediatypes`**: defines whether to use OCI mediatypes in exported manifests. its default value is `true`*Optional*.
103+
- **`wave.build.oci-mediatypes`**: defines whether to use OCI media types in exported manifests. Its default value is `true`*Optional*.
105104

106105
- **`wave.build.compression`**: defines which type of compression will be applied to cache layers. its default value is `gzip` and other options are `uncompressed|estargz|zstd`*Optional*.
107106

@@ -113,6 +112,10 @@ This configuration specifies attributes for the persistence of the logs fetched
113112

114113
- **`wave.build.logs.bucket`**: the AWS S3 bucket where Wave will store build process logs. *Mandatory*.
115114

115+
- **`wave.build.logs.path`**: the path inside `wave.build.logs.bucket`, where build logs will be stored. *Mandatory*.
116+
117+
- **`wave.build.locks.path`**: the path inside `wave.build.logs.bucket`, where conda lock files will be stored. *Mandatory*.
118+
116119
- **`wave.build.logs.prefix`**: sets the prefix to be used for build process log files in the specified S3 bucket. *Optional*.
117120

118121
- **`wave.build.logs.maxLength`**: determines the maximum number of bytes that can be read from a log file. If a log file exceeds this limit, it will be truncated. The default value is `100000` (100 KB). *Optional*.
@@ -122,7 +125,9 @@ This configuration specifies attributes for the persistence of the logs fetched
122125

123126
Kubernetes configuration has options specific for k8s, and most of them, except CPU and memory, are the same for the build and scan process.
124127

125-
**Note**: only applies when using Kubernetes.
128+
:::note
129+
These settings apply only when running on Kubernetes.
130+
:::
126131

127132
- **`wave.build.k8s.namespace`**: the Kubernetes namespace where Wave will run its build pods. This is a required setting, specifying the namespace to isolate and manage the Wave build processes within the Kubernetes cluster. *Mandatory*.
128133

@@ -156,7 +161,9 @@ Scan process configuration lets the user provide a [Trivy docker image](https://
156161

157162
Wave scan process uses the same k8s configuration of the build process except for CPU and memory requirements for the k8s pod.
158163

159-
**Note**: only applies when using Kubernetes.
164+
:::note
165+
These settings apply only when using Kubernetes.
166+
:::
160167

161168
- **`wave.scan.k8s.resources.requests.cpu`**: the amount of [CPU resources](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes) allocated to Wave scan processes. For instance, you can set it to `2` or `1500Mi` (1.5 CPU cores). *Optional*.
162169

@@ -166,7 +173,9 @@ Wave scan process uses the same k8s configuration of the build process except fo
166173

167174
Rate limit configuration controls the limits of anonymous and authenticated users' access to Wave.
168175

169-
**Note**: Change these properties to tweak rate limits in wave.
176+
:::note
177+
Change these properties to tweak rate limits in Wave.
178+
:::
170179

171180
- **`rate-limit.build.anonymous`**: the rate limit for anonymous build requests. By default, it allows up to 25 build requests per hour (`25/1d`) from anonymous users. This setting controls the frequency at which anonymous users can trigger build processes in Wave. *Mandatory*.
172181

@@ -180,19 +189,23 @@ Rate limit configuration controls the limits of anonymous and authenticated user
180189

181190
## Database and cache configuration
182191

192+
### Redis configuration
193+
183194
- **`redis.uri`**: the Uniform Resource Identifier (URI) for connecting to Redis, a popular in-memory data store. By default, it uses the format `redis://${REDIS_HOST:redis}:${REDIS_PORT:6379}`, allowing customization of the Redis host and port through environment variables. *Mandatory*.
184195

185196
- **`redis.pool.enabled`**: whether to enable the Redis pool. It is set to `true` by default, enabling the use of a connection pool for efficient management of connections to the Redis server. *Optional*.
186197

187-
- **`redis.pool.minIdle`**: Specifies the minimum number of idle connections to maintain in the Redis connection pool. The default value is `0`. This ensures that connections are readily available for use.  *Optional*.
198+
- **`redis.pool.minIdle`**: specifies the minimum number of idle connections to maintain in the Redis connection pool. The default value is `0`. This ensures that connections are readily available for use.  *Optional*.
188199

189-
- **`redis.pool.maxIdle`**: Specifies the maximum number of idle connections to maintain in the Redis connection pool. The default value is `10`.  *Optional*.
200+
- **`redis.pool.maxIdle`**: specifies the maximum number of idle connections to maintain in the Redis connection pool. The default value is `10`.  *Optional*.
190201

191-
- **`redis.pool.maxTotal`**: Specifies the maximum number of connections that can be maintained in the Redis connection pool. The default value is `50`. This helps to manage resource usage efficiently while supporting high demand.  *Optional*.
202+
- **`redis.pool.maxTotal`**: specifies the maximum number of connections that can be maintained in the Redis connection pool. The default value is `50`. This helps to manage resource usage efficiently while supporting high demand.  *Optional*.
192203

193-
- **`redis.client.timeout`**: Defines the timeout duration (in milliseconds) for Redis client operations. The default value is `5000` (5 seconds).  *Optional*.
204+
- **`redis.client.timeout`**: defines the timeout duration (in milliseconds) for Redis client operations. The default value is `5000` (5 seconds).  *Optional*.
194205

195-
- **`redis.password`**: Specifies the password used to authenticate with the Redis server. This is needed when redis authentication is enabled.  *Optional*.
206+
- **`redis.password`**: specifies the password used to authenticate with the Redis server. This is needed when redis authentication is enabled.  *Optional*.
207+
208+
### SurrealDB configuration
196209

197210
- **`surreal.default.ns`**: the namespace for the Surreal database. It can be set using `${SURREALDB_NS}` environment variable. *Mandatory*.
198211

@@ -206,6 +219,14 @@ Rate limit configuration controls the limits of anonymous and authenticated user
206219

207220
- **`surreal.default.init-db`**: whether to create database tables, records and indices at application startup and `db`*Optional*.
208221

222+
### PostgreSQL configuration
223+
224+
- **`wave.db.uri`**: JDBC connection string for the PostgreSQL database. For example, `jdbc:postgresql://localhost:5432/wave`. It can be set using `${WAVE_DB_URI}` environment variable.  *Mandatory*.
225+
226+
- **`wave.db.user`**: Username for authenticating with the PostgreSQL database. It can be set using `${WAVE_DB_USER}` environment variable. *Mandatory*.
227+
228+
- **`wave.db.password`**: Password for the PostgreSQL database user. It can be set using `${WAVE_DB_PASSWORD}` environment variable. *Mandatory*.
229+
209230
## Blob Cache configuration
210231

211232
Wave offers a feature to provide a cache for Docker blobs, which improves the performance of supplying blobs to the client. If you use Kubernetes, Wave can also use the k8s pod to delegate the transfer task for scalability.
@@ -222,7 +243,7 @@ Wave offers a feature to provide a cache for Docker blobs, which improves the pe
222243

223244
- **`wave.blobCache.baseUrl`**: the URL, which will override the base URL (part of URL before the blob path) of blobs sent to the end client. *Optional*.
224245

225-
- **`wave.blobCache.signing-strategy`**: the URL signing strategy for different services. Currently, Wave offers it for AWS S3 and Cloudflare and you can use the respective values to enable them `aws-presigned-url` and `cloudflare-waf-token`*Mandatory*.
246+
- **`wave.blobCache.signing-strategy`**: the URL signing strategy for different services. Currently, Wave offers it for AWS S3 and Cloudflare and you can use the respective values to enable them `aws-presigned-url` and `cloudflare-waf-token`*Mandatory*.
226247

227248
- **`wave.blobCache.cloudflare.lifetime`**: the validity of the cloud flare WAF token. *Mandatory*.
228249

@@ -246,20 +267,20 @@ Wave offers a feature to provide a cache for Docker blobs, which improves the pe
246267

247268
## Email configuration
248269

249-
Email id to send emails from on the behalf of the Wave service.
270+
Email ID to send emails from on the behalf of the Wave service.
250271

251-
- **`mail.from`**: specifies the sender's email address for Wave notifications. This email address serves as the point of origin for any emails sent by Wave, providing a recognizable source for notifications. This setting is crucial for configuring the sender identity when Wave sends email notifications. *Mandatory*.
272+
- **`mail.from`**: specifies the sender's email address for Wave notifications. This email address serves as the point of origin for any emails sent by Wave, providing a recognizable source for notifications. This setting is crucial for configuring the sender identity when Wave sends email notifications.  *Mandatory*.
252273

253274
## Metrics configuration
254275

255276
Wave Metrics service provides data about container builds and pulls per ip, container image, and user.
256277

257-
- **`wave.metrics.enabled`**: whether to enable the wave metrics. It is `false` by default. *Optional*.
278+
- **`wave.metrics.enabled`**: whether to enable the Wave metrics. It is `false` by default. *Optional*.
258279

259280
## Accounts configuration
260281

261-
- **`wave.accounts`**: Specifies a list of credentials to access authenticated wave APIs like metrics APIs. *Mandatory*.<br/>
282+
- **`wave.accounts`**: specifies a list of credentials to access authenticated Wave APIs like metrics APIs. *Mandatory*.<br/>
262283
Format of the credential list
263284
```
264-
- <USERNAME>:<PASSWORD CHECKSUM>
285+
- <USERNAME>:<PASSWORD_CHECKSUM>
265286
```

docs/db-migration.mdx

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Wave Database Migration from SurrealDB to PostgreSQL
2+
3+
## Pre-requisites
4+
- Install [wave-cli] (https://github.com/seqeralabs/wave-cli)
5+
- Ensure you have a PostgreSQL database set up and accessible from wave.
6+
7+
## Migration Steps
8+
1. Create verification data, run some builds, scans, augmentation and mirror operations in Wave and note down buildId, scanId, token and mirrorId respectively for verification.
9+
#### commands:
10+
- ```bash
11+
wave --conda-package bwa --wave-endpoint <WAVE_URL>
12+
```
13+
- ```bash
14+
curl <WAVE_URL>/view/builds/<buildId>
15+
```
16+
- ```bash
17+
curl <WAVE_URL>/view/scans/<scanId>
18+
```
19+
- ```bash
20+
wave -i ubuntu --config-file <path_to_config_file> --wave-endpoint <WAVE_URL>
21+
```
22+
- ```bash
23+
curl <WAVE_URL>/view/containers/<token>
24+
```
25+
- ```bash
26+
wave --mirror -i ubuntu --build-repo <repo_where_you_w>--wave-endpoint <WAVE_URL>
27+
```
28+
- ```bash
29+
curl <WAVE_URL>/view/mirrors/<mirrorId>
30+
```
31+
1. Ensure you have all necessary credentials for both [SurrealDB](configuration.mdx#SurrealDB configuration) and [PostgreSQL](configuration.mdx#PostgreSQL configuration).
32+
2. Enable the following environment by adding them in `MICRONAUT_ENVIRONMENTS`:
33+
- `postgres`
34+
- `surrealdb`
35+
- `migrate`
36+
- `redis`
37+
3. Start Wave application and check whether the migration is successful by checking the logs.
38+
```
39+
INFO i.s.w.s.p.m.DataMigrationService - Data migration service initialized
40+
```
41+
4. check for the following logs:
42+
```
43+
INFO i.s.w.s.p.m.DataMigrationService - All wave_request records migrated.
44+
INFO i.s.w.s.p.m.DataMigrationService - All wave_scan records migrated.
45+
INFO i.s.w.s.p.m.DataMigrationService - All wave_build records migrated.
46+
INFO i.s.w.s.p.m.DataMigrationService - All wave_mirror records migrated.
47+
```
48+
5. Remove the `migrate` and `surrealdb`environment from `MICRONAUT_ENVIRONMENTS` to stop the migration process and restart wave.
49+
50+
6. Verify the migration by checking the PostgreSQL database for the migrated data and also run same curl from step one.
51+
- ```bash
52+
curl <WAVE_URL>/view/builds/<buildId>
53+
```
54+
- ```bash
55+
curl <WAVE_URL>/view/scans/<scanId>
56+
```
57+
- ```bash
58+
curl <WAVE_URL>/view/containers/<token>
59+
```
60+
- ```bash
61+
curl <WAVE_URL>/view/mirrors/<mirrorId>
62+
```
63+

docs/get-started.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Nextflow can use the container that Seqera Containers built in the previous sect
3939

4040
1. Create a `main.nf` file with the following contents:
4141

42-
```groovy
42+
```nextflow
4343
process SAMTOOLS {
4444
container '<container_uri>'
4545
debug true
@@ -164,7 +164,7 @@ Nextflow can use Wave to seamlessly build a container directly from a Dockerfile
164164

165165
1. Create a `wave.nf` file with the following contents:
166166

167-
```groovy
167+
```nextflow
168168
include { HELLO } from './modules/gamma'
169169
170170
workflow {
@@ -329,7 +329,7 @@ Nextflow can use the container that Wave froze to the build repository that you
329329

330330
1. Create a `main.nf` file with the following contents:
331331

332-
```groovy
332+
```nextflow
333333
process FAKER {
334334
container 'docker.io/example-user/repo:faker--2aa7a4d826a76301'
335335
debug true

src/test/groovy/io/seqera/wave/auth/RegistryAuthServiceTest.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ class RegistryAuthServiceTest extends Specification implements SecureDockerRegis
5454
String quayPassword
5555

5656
@Shared
57-
@Value('${wave.registries.seqeralabs.azurecr.io.username}')
57+
@Value('${wave.registries.wavetest.azurecr.io.username}')
5858
String azureUsername
5959
@Shared
60-
@Value('${wave.registries.seqeralabs.azurecr.io.password}')
60+
@Value('${wave.registries.wavetest.azurecr.io.password}')
6161
String azurePassword
6262

6363
@Shared
@@ -98,7 +98,7 @@ class RegistryAuthServiceTest extends Specification implements SecureDockerRegis
9898
@IgnoreIf({!System.getenv('AZURECR_USER')})
9999
void 'test valid azure login'() {
100100
given:
101-
def REGISTRY_URL = 'seqeralabs.azurecr.io'
101+
def REGISTRY_URL = 'wavetest.azurecr.io'
102102

103103
expect:
104104
loginService.login(REGISTRY_URL, azureUsername, azurePassword)

0 commit comments

Comments
 (0)