Skip to content

Commit

Permalink
Merge branch 'master' into virtual-threads-phase2
Browse files Browse the repository at this point in the history
  • Loading branch information
pditommaso authored Feb 21, 2025
2 parents a60710c + f5369ee commit 8078ffe
Show file tree
Hide file tree
Showing 112 changed files with 2,554 additions and 1,073 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/typespec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ on:
- '**'
paths :
- 'typespec/**'
- VERSION
pull_request:
types: [opened, reopened, synchronize]
paths:
- 'typespec/**'
- VERSION

permissions:
contents: read
Expand All @@ -30,11 +32,26 @@ jobs:
node-version : '20.9.0'

- name : Install tsp
run : npm install -g @typespec/compiler
run : npm install -g @typespec/compiler@0.64.0

- name : Validate tsp files
run : |
cd typespec
tsp install
tsp compile .
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{secrets.TOWER_CI_AWS_ACCESS}}
aws-secret-access-key: ${{secrets.TOWER_CI_AWS_SECRET}}
aws-region: eu-west-1

- name : Login to Amazon ECR
id : login-ecr
uses : aws-actions/amazon-ecr-login@v1

- name: Release OpenAPI docs
if: "contains(github.event.head_commit.message, '[release]')"
run: |
bash typespec/tag-and-push-openapi.sh
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.16.0
1.18.0
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ repositories {
mavenCentral()
maven { url = 'https://s3-eu-west-1.amazonaws.com/maven.seqera.io/releases' }
maven { url = 'https://s3-eu-west-1.amazonaws.com/maven.seqera.io/snapshots' }
maven { url = 'https://jitpack.io' }
}

dependencies {
Expand All @@ -35,9 +34,10 @@ dependencies {
compileOnly 'io.micronaut:micronaut-inject-groovy'
compileOnly 'io.micronaut:micronaut-http-validation'
implementation 'jakarta.persistence:jakarta.persistence-api:3.0.0'
api 'io.seqera:lib-mail:1.2.1'
api 'io.seqera:wave-api:0.14.0'
api 'io.seqera:wave-utils:0.15.0'
implementation 'io.seqera:lib-mail:1.2.1'
implementation 'io.seqera:lib-pool:1.0.0'
implementation 'io.seqera:wave-api:0.15.1'
implementation 'io.seqera:wave-utils:0.15.1'
implementation 'io.seqera:lib-crypto:1.0.0'
implementation 'io.micronaut:micronaut-http-client'
implementation 'io.micronaut:micronaut-jackson-databind'
Expand Down Expand Up @@ -88,7 +88,7 @@ dependencies {
testImplementation 'org.testcontainers:mysql:1.17.3'

// --
implementation 'ch.qos.logback:logback-classic:1.5.12'
implementation 'ch.qos.logback:logback-classic:1.5.16'

// rate limit
implementation 'com.coveo:spillway:3.0.0'
Expand All @@ -104,7 +104,7 @@ dependencies {
// upgrade indirect dependencies
runtimeOnly 'org.bouncycastle:bcpkix-jdk18on:1.78'
runtimeOnly 'org.bitbucket.b_c:jose4j:0.9.4'
runtimeOnly 'io.netty:netty-bom:4.1.115.Final'
runtimeOnly 'io.netty:netty-bom:4.1.118.Final'
runtimeOnly 'com.google.protobuf:protobuf-java:4.27.5'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,12 @@ repositories {
}

java {
// these settings apply to all jvm tooling, including groovy
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}

compileJava {
options.release.set(17)
}

tasks.withType(GroovyCompile).configureEach {
sourceCompatibility = '17'
targetCompatibility = '17'
sourceCompatibility = 17
targetCompatibility = 17
}

group = 'io.seqera'
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,12 @@ repositories {
}

java {
// these settings apply to all jvm tooling, including groovy
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}

compileJava {
options.release.set(17)
}

tasks.withType(GroovyCompile).configureEach {
sourceCompatibility = '17'
targetCompatibility = '17'
sourceCompatibility = 17
targetCompatibility = 17
}

test {
Expand All @@ -43,8 +37,8 @@ dependencies {
implementation 'org.slf4j:slf4j-api:2.0.16'
implementation 'org.slf4j:slf4j-jdk-platform-logging:2.0.16'

testImplementation 'ch.qos.logback:logback-core:1.5.12'
testImplementation 'ch.qos.logback:logback-classic:1.5.12'
testImplementation 'ch.qos.logback:logback-core:1.5.13'
testImplementation 'ch.qos.logback:logback-classic:1.5.13'
testImplementation 'org.apache.groovy:groovy:4.0.15'
testImplementation 'org.apache.groovy:groovy-nio:4.0.15'
testImplementation 'org.apache.groovy:groovy-test:4.0.15'
Expand Down
73 changes: 72 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,76 @@
# Wave changelog
1.16.0 - 9 Dec 2024
1.18.0 - 18 Feb 2025
- Add Scan image request (#796) [a950d1cf]
- Improve caching for AWS ECR and Auth lookup (#783) [b1a76d15]
- Improve jwt debug logs [086837e9]
- Use route target path as proxy cache key (#788) [1133c348]
- Bump Micronaut to version 4.7.6 [97544609]
- Bump io.netty:netty-bom:4.1.118.Final [5a861f51]

1.17.2 - 10 Feb 2025
- Change threads dump-threshold default to 200 [5d136e45]
- Minor inspect view improvements (#795) [242822fd]
- Bump gradle 8.12.1 [6b85565e]
- Bump MN version 4.7.5 [03febd69]

1.17.1 - 4 Feb 2025
- Add container index support to inspect view (#792) [34428d25]
- Remove server from openapi spec (#793) [9cbdec1d]

1.17.0 - 30 Jan 2025
- Ignore URI dependencies in Conda envs when generating image hash (#786) [c097c8a2]
- Render html from openapi spec generated by typespec (#707) [d3dfee9a]
- Disable proxy cache by default [c91fc31f]
- Update gradle deps [8a2e4209]
- Bump buildkit to version 0.18.2 (#787) [facbf99c]
- Bump java settings [1f6b94da]

1.16.8 - 20 Jab 2025
- Add TraceContextFilter logging context propagation [396c10c2]
- Improve Proxy cache configuration [163e605f]
- Improve logging pattern [0ab87164]
- Improve request caching logic [a95153be]
- Bump MN 4.7.4 [4ce2a139]

1.16.7 - 10 Jan 2025
- Improve logging on pairing websocket error [21861dbe]

1.16.6 - 7 Jan 2025
- Fix Use caffeine for tiered cache lock cache (#785) [bb5f4dd0]
- Tune trace timeouts [d6bf2236]

1.16.5 - 30 Dec 2024
- Fix Missing legacy classes deserialization [7687cd24]

1.16.4 - 30 Dec 2024
- Add custom toString method DelegateResponse class [6feb386a]
- Add isTraceEnable if guard to log traces [166ca37f]
- Add trace execution elapsed time logic (#497) [9e25687f]
- Fix duplicate add-opens option in launch script [a2722115]
- Fix invalid expiresAt time in L1 tiered cache [38737127]
- Fix missing workspaceId in launch API (#780) [c0d41336]
- Use look pool for cache sync [29db0360]
- Use blocking executor with PullMetricsRequestsFilter class [e10f3275]
- Use lib-pool library [33d9d4d3]
- Use platform thread to read target request body [053ba8d9]
- Refactor container request service [955d9894]
- Refactor platform client model [8c7a9825]
- Remove unneeded user async api (#781) [814c35ee]
- Bump MN 4.7.2 [702658b2]

1.16.3 - 22 Dec 2024
- Improve tiered cache (#779) [01d5f183]
- Bump logback 1.5.13 [1466c276]

1.16.2 - 20 Dec 2024
- Fix JWT token refresh [52a5ebd7]

1.16.1 - 20 Dec 2024
- Add tiered cache for HTTP proxied responses (#778) [00b6add7]
- Improve bootstrap info [d5c086da]
- Remove jitpack [67f91c8b]

1.16.0 - 17 Dec 2024
- Add support for mills resolution future store [252e0985]
- Fix Condalock fetching for cached build layers (#727) [13a59373]
- Fix NPE while creating PairingOutboundQueue (#770) [215f6da8]
Expand Down
6 changes: 3 additions & 3 deletions configuration.md → docs/configuration.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Wave Application Configuration

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

### config.yml configuration

Declare YAML configuration values in [`config.yml`](./config.yml)
Declare YAML configuration values in [`config.yml`](https://github.com/seqeralabs/wave/blob/master/config.yml)
```
wave:
mail:
Expand Down Expand Up @@ -39,7 +39,7 @@ The generic format for the attributes is `wave.registries.<registry_name>.userna
You need to specify all the repositories you will use in the respective wave installation.
Below are the standard format for known registries, but you can change registry name `(azurecr.io)` to specific one like `seqeralabs.azurecr.io `.

**Note**: Container registry credentials can be defined in [`config.yml`](./config.yml) too. These configurations are important for the wave authentication to the repositories used to push or pull artifacts.
**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.

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

Expand Down
4 changes: 1 addition & 3 deletions docs/metrics.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
title: Usage metrics
---
# Usage metrics

Wave uses Redis to store its usage metrics for a specific date and/or a specific organization.

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#

micronautVersion=4.7.1
micronautVersion=4.7.6
micronautEnvs=dev,h2,mail,aws-ses
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
41 changes: 41 additions & 0 deletions src/main/groovy/io/seqera/util/trace/TraceElapsedTime.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Wave, containers provisioning service
* Copyright (c) 2023-2024, Seqera Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package io.seqera.util.trace

import java.lang.annotation.Documented
import java.lang.annotation.Retention
import java.lang.annotation.Target

import io.micronaut.aop.Around
import static java.lang.annotation.ElementType.METHOD
import static java.lang.annotation.ElementType.TYPE
import static java.lang.annotation.RetentionPolicy.RUNTIME
/**
* When applied to a method or a class the elapsed time to carry out the method execution
* is reported in the application log file
*
* @author Paolo Di Tommaso <paolo.ditommaso@gmail.com>
*/
@Documented
@Retention(RUNTIME)
@Target([TYPE, METHOD])
@Around
@interface TraceElapsedTime {
String thresholdMillis() default '0'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* Wave, containers provisioning service
* Copyright (c) 2023-2024, Seqera Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package io.seqera.util.trace

import java.time.Duration

import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
import io.micronaut.aop.InterceptorBean
import io.micronaut.aop.MethodInterceptor
import io.micronaut.aop.MethodInvocationContext
import jakarta.inject.Singleton
/**
* Implements an method interceptor that logs the elapsed time to carry out the execution
* of method invocation.
*
* This interceptor is applied to classes or methods marked in the {@link TraceElapsedTime} annotation
*
* @author Paolo Di Tommaso <paolo.ditommaso@gmail.com>
*/
@CompileStatic
@Slf4j
@Singleton
@InterceptorBean(TraceElapsedTime)
class TraceElapsedTimeInterceptor implements MethodInterceptor<Object,Object> {

@Override
Object intercept(MethodInvocationContext<Object, Object> context) {
// get the threshold value from the TraceElapsedTime annotation
final annot = context.getAnnotation(TraceElapsedTime)
final threshold = annot.intValue('thresholdMillis').orElse(0)

// apply it
Object result=null
final begin = System.currentTimeMillis()
try {
return result = context.proceed()
}
finally {
final delta = System.currentTimeMillis() - begin
if( delta>=threshold ) {
log.debug(msg(delta,context,result))
}
}
}

static private String msg(long delta,MethodInvocationContext<Object, Object> context, Object result) {
final method = context.getDeclaringType().getSimpleName() + '.' + context.getMethodName()
def msg = "Slow method detected - elapsed time: ${Duration.ofMillis(delta)}"
msg += "\n - name : ${method}"
for( Map.Entry entry : context.getParameterValueMap() ) {
msg += "\n - parameter: ${entry.key}=${entry.value}"
}
if( !context.getReturnType().isVoid() )
msg += "\n - result : ${result}"
return msg
}
}
3 changes: 2 additions & 1 deletion src/main/groovy/io/seqera/wave/auth/RegistryAuth.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import java.util.regex.Pattern
import groovy.transform.Canonical
import groovy.transform.CompileStatic
import groovy.transform.ToString
import io.seqera.wave.encoder.MoshiSerializable

/**
* Model container registry authentication meta-info
Expand All @@ -32,7 +33,7 @@ import groovy.transform.ToString
@Canonical
@CompileStatic
@ToString(includePackage = false, includeNames = true)
class RegistryAuth {
class RegistryAuth implements MoshiSerializable {

private static final Pattern AUTH = ~/(?i)(?<type>.+) realm="(?<realm>[^"]+)",service="(?<service>[^"]+)"/
// some registries doesn't send the service
Expand Down
Loading

0 comments on commit 8078ffe

Please sign in to comment.