-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 314-update-to-micronaut-41
- Loading branch information
Showing
23 changed files
with
637 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# 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/>. | ||
# | ||
|
||
arch=$(uname -m) | ||
|
||
case $arch in | ||
x86_64|amd64) | ||
echo "https://github.com/peak/s5cmd/releases/download/v$1/s5cmd_$1_Linux-64bit.tar.gz" | ||
;; | ||
aarch64|arm64) | ||
echo "https://github.com/peak/s5cmd/releases/download/v$1/s5cmd_$1_Linux-arm64.tar.gz" | ||
;; | ||
*) | ||
echo "Unknown architecture: $arch" | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,19 +22,24 @@ import java.time.Instant | |
|
||
import groovy.transform.Canonical | ||
import groovy.transform.CompileStatic | ||
import groovy.transform.ToString | ||
import groovy.util.logging.Slf4j | ||
/** | ||
* Model a blob cache metadata entry | ||
* | ||
* @author Paolo Di Tommaso <[email protected]> | ||
*/ | ||
@Slf4j | ||
@ToString(includePackage = false, includeNames = true, excludes = ['headers','logs']) | ||
@Canonical | ||
@CompileStatic | ||
class BlobCacheInfo { | ||
|
||
enum State { CREATED, CACHED, COMPLETED, ERRORED, UNKNOWN } | ||
|
||
/** | ||
* The Blob state | ||
*/ | ||
final State state | ||
|
||
/** | ||
* The HTTP location from the where the cached container blob can be retrieved | ||
*/ | ||
|
@@ -113,7 +118,7 @@ class BlobCacheInfo { | |
final type = headerString0(response, 'Content-Type') | ||
final cache = headerString0(response, 'Cache-Control') | ||
final creationTime = Instant.now() | ||
return new BlobCacheInfo(locationUri, objectUri, headers0, length, type, cache, creationTime, null, null, null) | ||
return new BlobCacheInfo(State.CREATED, locationUri, objectUri, headers0, length, type, cache, creationTime, null, null, null) | ||
} | ||
|
||
static String headerString0(Map<String,List<String>> headers, String name) { | ||
|
@@ -130,8 +135,28 @@ class BlobCacheInfo { | |
} | ||
} | ||
|
||
@Override | ||
String toString() { | ||
if( state==State.UNKNOWN ) { | ||
return "BlobCacheInfo(UNKNOWN)" | ||
} | ||
|
||
return "BlobCacheInfo(" + | ||
"state=" + state + | ||
", locationUri='" + locationUri + "'" + | ||
", objectUri='" + objectUri + "'" + | ||
", contentLength=" + contentLength + | ||
", contentType='" + contentType + "'" + | ||
", cacheControl='" + cacheControl + "'" + | ||
", creationTime=" + creationTime + | ||
", completionTime=" + completionTime + | ||
", exitStatus=" + exitStatus + | ||
')' | ||
} | ||
|
||
BlobCacheInfo cached() { | ||
new BlobCacheInfo( | ||
State.CACHED, | ||
locationUri, | ||
objectUri, | ||
headers, | ||
|
@@ -147,6 +172,7 @@ class BlobCacheInfo { | |
|
||
BlobCacheInfo completed(int status, String logs) { | ||
new BlobCacheInfo( | ||
State.COMPLETED, | ||
locationUri, | ||
objectUri, | ||
headers, | ||
|
@@ -160,8 +186,9 @@ class BlobCacheInfo { | |
) | ||
} | ||
|
||
BlobCacheInfo failed(String logs) { | ||
BlobCacheInfo errored(String logs) { | ||
new BlobCacheInfo( | ||
State.ERRORED, | ||
locationUri, | ||
objectUri, | ||
headers, | ||
|
@@ -177,6 +204,7 @@ class BlobCacheInfo { | |
|
||
BlobCacheInfo withLocation(String location) { | ||
new BlobCacheInfo( | ||
state, | ||
location, | ||
objectUri, | ||
headers, | ||
|
@@ -191,7 +219,7 @@ class BlobCacheInfo { | |
} | ||
|
||
static BlobCacheInfo unknown(String logs) { | ||
new BlobCacheInfo(null, null, null, null, null, null, Instant.ofEpochMilli(0), Instant.ofEpochMilli(0), null, logs) { | ||
new BlobCacheInfo(State.UNKNOWN, null, null, null, null, null, null, Instant.ofEpochMilli(0), Instant.ofEpochMilli(0), null, logs) { | ||
@Override | ||
BlobCacheInfo withLocation(String uri) { | ||
// prevent the change of location for unknown status | ||
|
@@ -200,4 +228,5 @@ class BlobCacheInfo { | |
} | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,10 +23,12 @@ import java.time.Duration | |
import groovy.transform.CompileStatic | ||
import groovy.transform.ToString | ||
import io.micronaut.context.annotation.Value | ||
import io.seqera.wave.util.DurationUtils | ||
import jakarta.inject.Singleton | ||
|
||
/** | ||
* | ||
* Model JWT refreshing service config | ||
* | ||
* @author Paolo Di Tommaso <[email protected]> | ||
*/ | ||
@Singleton | ||
|
@@ -59,4 +61,8 @@ class JwtConfig { | |
@Value('${wave.jwt.monitor.count:10}') | ||
int monitorCount | ||
|
||
Duration getMonitorDelayRandomized() { | ||
DurationUtils.randomDuration(monitorDelay, 0.4f) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.