Skip to content

Commit c7acffc

Browse files
feat: add --ecs-config option for AWS Batch Forge CE (#558)
1 parent e0c7186 commit c7acffc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/main/java/io/seqera/tower/cli/commands/computeenvs/platforms/AwsBatchForgePlatform.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import io.seqera.tower.ApiException;
2121
import io.seqera.tower.cli.exceptions.TowerException;
22+
import io.seqera.tower.cli.utils.FilesHelper;
2223
import io.seqera.tower.model.AwsBatchConfig;
2324
import io.seqera.tower.model.ComputeEnvComputeConfig.PlatformEnum;
2425
import io.seqera.tower.model.ForgeConfig;
@@ -28,6 +29,7 @@
2829
import picocli.CommandLine.Option;
2930

3031
import java.io.IOException;
32+
import java.nio.file.Path;
3133
import java.util.List;
3234

3335
public class AwsBatchForgePlatform extends AbstractPlatform<AwsBatchConfig> {
@@ -74,6 +76,9 @@ public class AwsBatchForgePlatform extends AbstractPlatform<AwsBatchConfig> {
7476
@Option(names = "--preserve-resources", description = "Enable this if you want to preserve the Batch compute resources created by Tower independently from the lifecycle of this compute environment.")
7577
public boolean preserveResources;
7678

79+
@Option(names = {"--ecs-config"}, description = "Path to ECS agent configuration file - custom configuration for the ECS agent parameters used by AWS Batch. This is appended to the /etc/ecs/ecs.config file in each cluster node.")
80+
public Path ecsConfig;
81+
7782
@ArgGroup(heading = "%nEFS filesystem options:%n", validate = false)
7883
public EfsFileSystem efs;
7984
@ArgGroup(heading = "%nFSX filesytem options:%n", validate = false)
@@ -130,7 +135,7 @@ private Boolean isFusionV2Enabled() throws TowerException {
130135
return fusionV2;
131136
}
132137

133-
private ForgeConfig buildForge() throws TowerException {
138+
private ForgeConfig buildForge() throws TowerException, IOException {
134139

135140
// TODO: delete this once fusion v1 is completely removed
136141
if (fusion) {
@@ -155,7 +160,8 @@ private ForgeConfig buildForge() throws TowerException {
155160
.ebsBlockSize(adv().ebsBlockSize)
156161
.ebsBootSize(adv().bootDiskSizeGb)
157162
.bidPercentage(adv().bidPercentage)
158-
.fargateHeadEnabled(fargate);
163+
.fargateHeadEnabled(fargate)
164+
.ecsConfig(FilesHelper.readString(ecsConfig));
159165

160166

161167
if (efs != null) {

0 commit comments

Comments
 (0)