Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION-API
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1.145.0
1.148.0
// Only first line of this file is read
// This version should be bumped to the minimum version where dependent API changes were introduced
// But never higher then the current Platform API Version deployed in Cloud Production: https://cloud.seqera.io/api/service-info
49 changes: 39 additions & 10 deletions conf/reflect-config.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
[versions]
classgraphVersion = "4.8.180"
commonsCompressVersion = "1.28.0"
commonsIoVersion = "2.21.0"
commonsIoVersion = "2.22.0"
graalvmNativeVersion = "0.10.6"
jacksonDatabindNullableVersion = "0.2.8"
jacksonDatabindNullableVersion = "0.2.10"
jakartaAnnotationVersion = "3.0.0"
javaxAnnotationVersion = "1.3.2"
jerseyVersion = "2.47"
junitVersion = "5.12.2"
licenserVersion = "2.2.2"
licenserVersion = "3.0.1"
logbackVersion = "1.5.32"
mockserverVersion = "5.15.0"
picocliVersion = "4.6.3"
shadowVersion = "9.3.1"
shadowVersion = "9.4.1"
slf4jVersion = "2.0.17"
towerJavaSdkVersion = "1.145.0"
towerJavaSdkVersion = "1.148.0"
xzVersion = "1.10"

[libraries]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,15 @@ public AwsCloudConfig computeConfig() throws ApiException, IOException {
.region(region)
.allowBuckets(allowBuckets);

if (sched != null && sched.provisioningModel != null) {
config.schedConfig(new SchedConfig().provisioningModel(sched.provisioningModel));
if (sched != null) {
SchedConfig schedConfig = new SchedConfig();
if (sched.provisioningModel != null) {
schedConfig.provisioningModel(sched.provisioningModel);
}
if (sched.machineTypes != null) {
schedConfig.machineTypes(sched.machineTypes);
}
config.schedConfig(schedConfig);
}

// Advanced
Expand Down Expand Up @@ -93,6 +100,9 @@ public static class SchedOptions {

@Option(names = {"--provisioning-model"}, description = "Instance provisioning model used by the Seqera scheduler. Valid values: SPOT, SPOT_FIRST, ONDEMAND.")
public SchedConfig.ProvisioningModelEnum provisioningModel;

@Option(names = {"--sched-machine-types"}, description = "EC2 instance types for compute nodes managed by the Seqera scheduler. Comma-separated list (e.g., m5.xlarge,c5.2xlarge). Leave empty to let the scheduler select the most cost-effective types.", split = ",")
public List<String> machineTypes;
}

public static class AdvancedOptions {
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/io/seqera/tower/cli/InfoCmdTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void testInfo(OutputType format, MockServerClient mock) throws IOException {
Map<String, String> opts = new HashMap<>();
opts.put("cliVersion", getCliVersion() );
opts.put("cliApiVersion", getCliApiVersion());
opts.put("towerApiVersion", "1.145.0");
opts.put("towerApiVersion", "1.148.0");
opts.put("towerVersion", "22.3.0-torricelli");
opts.put("towerApiEndpoint", "http://localhost:"+mock.getPort());
opts.put("userName", "jordi");
Expand Down Expand Up @@ -86,7 +86,7 @@ void testInfoStatusTokenFail(MockServerClient mock) throws IOException {
Map<String, String> opts = new HashMap<>();
opts.put("cliVersion", getCliVersion() );
opts.put("cliApiVersion", getCliApiVersion());
opts.put("towerApiVersion", "1.145.0");
opts.put("towerApiVersion", "1.148.0");
opts.put("towerVersion", "22.3.0-torricelli");
opts.put("towerApiEndpoint", "http://localhost:"+mock.getPort());
opts.put("userName", null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,70 @@ void testAddWithProvisioningModel(MockServerClient mock) throws IOException {
assertEquals(expected.toString(), out.stdOut);
}

@Test
void testAddWithSchedMachineTypes(MockServerClient mock) throws IOException {
mock.reset();

// given
mock.when(
request()
.withMethod("GET")
.withPath("/credentials")
.withQueryStringParameter("platformId", "aws-cloud"),
exactly(1)
).respond(
response()
.withStatusCode(200)
.withContentType(MediaType.APPLICATION_JSON)
.withBody("{\"credentials\":[{\"id\":\"6XfOhoztUq6de3Dw3X9LSb\",\"name\":\"aws\",\"description\":null,\"discriminator\":\"aws\",\"baseUrl\":null,\"category\":null,\"deleted\":null,\"lastUsed\":\"2021-09-08T18:20:46Z\",\"dateCreated\":\"2021-09-08T12:57:04Z\",\"lastUpdated\":\"2021-09-08T12:57:04Z\"}]}")
);

mock.when(
request()
.withMethod("POST")
.withPath("/compute-envs")
.withBody(json("""
{
"computeEnv": {
"name": "my-aws-cloud-sched-mt",
"platform": "aws-cloud",
"config": {
"workDir": "s3://my-bucket",
"region": "us-east-1",
"fusion2Enabled": true,
"waveEnabled": true,
"schedEnabled": true,
"schedConfig": {
"machineTypes": ["m5.xlarge", "c5.2xlarge"]
}
},
"credentialsId": "6XfOhoztUq6de3Dw3X9LSb"
}
}""")),
exactly(1)
).respond(
response()
.withStatusCode(200)
.withContentType(MediaType.APPLICATION_JSON)
.withBody("{\"computeEnvId\":\"isnEDBLvHDAIteOEF44ow\"}")
);

// when
ExecOut out = exec(mock, "compute-envs", "add", "aws-cloud",
"-n", "my-aws-cloud-sched-mt",
"--work-dir", "s3://my-bucket",
"-r", "us-east-1",
"--sched-enabled",
"--sched-machine-types", "m5.xlarge,c5.2xlarge"
);

// then
var expected = new ComputeEnvAdded("aws-cloud", "isnEDBLvHDAIteOEF44ow", "my-aws-cloud-sched-mt", null, USER_WORKSPACE_NAME);
assertEquals("", out.stdErr);
assertEquals(0, out.exitCode);
assertEquals(expected.toString(), out.stdOut);
}

@Test
void testAddWithSchedEnabledForbidden(MockServerClient mock) throws IOException {
mock.reset();
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/runcmd/info/service-info.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"serviceInfo": {
"version": "22.3.0-torricelli",
"apiVersion": "1.145.0",
"apiVersion": "1.148.0",
"commitId": "3f04bfd4",
"authTypes": [
"github",
Expand Down
Loading