Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"overwrite" fails for multiple workspaces #209

Open
stevekm opened this issue Feb 27, 2025 · 0 comments
Open

"overwrite" fails for multiple workspaces #209

stevekm opened this issue Feb 27, 2025 · 0 comments

Comments

@stevekm
Copy link

stevekm commented Feb 27, 2025

It seems that if you are trying to create resources in multiple Workspaces in Seqera Platform, the overwrite feature of seqera-kit does not work.

Example;

# USAGE
# seqerakit -l DEBUG --env-file env.yml compute-envs-demo2.yml

compute-envs:
  - type: aws-batch
    config-mode: manual
    workspace: '$ORG_NAME/Dev' # dev workspace
    name: 'EBSAutoScale-Dev-test1'
    credentials: '$DEV_CREDENTIALS'
    work-dir: '$DEV_WORKDIR'
    region: '$AWS_REGION'
    head-queue: '$AWS_HEAD_QUEUE'
    compute-queue: '$AWS_WORK_QUEUE'
    overwrite: True
    wait: 'AVAILABLE'

  - type: aws-batch
    config-mode: manual
    workspace: '$ORG_NAME/$TENANT_WORKSPACE' # THIS IS A DIFFERENT WORKSPACE
    name: 'EBSAutoScale-Shared' # THIS IS A DIFFERENT CE NAME
    work-dir: '$TENANT_WORKDIR'
    credentials: '$TENANT_CREDENTIALS'
    region: '$AWS_REGION'
    head-queue: '$AWS_HEAD_QUEUE' # SAME AWS BATCH QUEUE's
    compute-queue: '$AWS_WORK_QUEUE' # SAME AWS BATCH QUEUE's
    overwrite: True
    wait: 'AVAILABLE'

Usage

$ seqerakit -l DEBUG --env-file env.yml compute-envs-demo2.yml
DEBUG:root: Overwrite is set to 'True' for compute-envs

INFO:root: Running command: tw -o json compute-envs list -w $ORG_NAME/Dev
INFO:root: Checking if name EBSAutoScale-Dev-test1 exists in Seqera Platform...
INFO:root: Running command: tw compute-envs add aws-batch manual --workspace $ORG_NAME/Dev --name EBSAutoScale-Dev-test1 --credentials $DEV_CREDENTIALS --work-dir $DEV_WORKDIR --region $AWS_REGION --head-queue $AWS_HEAD_QUEUE --compute-queue $AWS_WORK_QUEUE --wait AVAILABLE
INFO:root: Command output: New AWS-BATCH compute environment 'EBSAutoScale-Dev-test1' added at [MyOrg / Dev] workspace

  Waiting AVAILABLE status....AVAILABLE  [DONE]
New AWS-BATCH compute environment 'EBSAutoScale-Dev-test1' added at [MyOrg / Dev] workspace

  Waiting AVAILABLE status....AVAILABLE  [DONE]
DEBUG:root: Overwrite is set to 'True' for compute-envs

INFO:root: Checking if name EBSAutoScale-Shared exists in Seqera Platform...
INFO:root: Running command: tw compute-envs add aws-batch manual --workspace $ORG_NAME/$TENANT_WORKSPACE --name EBSAutoScale-Shared --work-dir $TENANT_WORKDIR --credentials $TENANT_CREDENTIALS --region $AWS_REGION --head-queue $AWS_HEAD_QUEUE --compute-queue $AWS_WORK_QUEUE --wait AVAILABLE
INFO:root: Command output: ERROR: A compute environment with name 'EBSAutoScale-Shared' already exists within the workspace 'MyTenant'
ERROR:root:Resource already exists. Please delete first or set 'overwrite: true'


In this case, the CE EBSAutoScale-Dev-test1 already existed in the 'Dev' workspace and gets deleted and re-created correctly.

However, the CE EBSAutoScale-Shared already exists in the MyTenant workspace ($TENANT_WORKSPACE) but seqera-kit does not check this and fails when it tries to create the CE that already exists. Despite the fact that overwrite: True is enabled for the creation of this CE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant