Skip to content

Conversation

@PauloMigAlmeida
Copy link
Contributor

When the network->enable toggle mechanism was implemented, I forgot to handle an edge case that I just realized today.

It causes some of the options on the start->options to be ignored when network->enable == false given the way that the function _get_network_commands used to work. This PR fixes this behaviour.

Example config:

agent:
  build:
    context: .
    recipe: ./recipes/corecli/main.def
    options:
      - fakeroot
  start:
    options:
      - containall
  network:
    enable: false
  volumes:
    - ./volumes/corecli/logs:/app_logs
  depends_on:
    - apollo

Before:

$ singularity-compose -f singularity-compose-local.yml --debug up

Creating agent
DEBUG singularity instance start \
    --bind <redacted>/volumes/corecli/logs:/app_logs \
    --bind <redacted>/resolv.conf:/etc/resolv.conf \
    --bind <redacted>/etc.hosts:/etc/hosts \
    --hostname agent \
    --writable-tmpfs \
    <redacted>/agent.sif agent 

After:

$ singularity-compose -f singularity-compose-local.yml --debug up

Creating agent
DEBUG singularity instance start \
    --bind <redacted>/volumes/corecli/logs:/app_logs \
    --bind <redacted>/resolv.conf:/etc/resolv.conf \
    --bind <redacted>/etc.hosts:/etc/hosts \
    --containall
    --hostname agent \
    --writable-tmpfs \
    <redacted>/agent.sif agent 

@vsoch
Copy link
Member

vsoch commented Dec 3, 2021

This looks good, and I like moving the addition of start_opts down into the root of creation instead of the function to get start options.

@vsoch vsoch merged commit f2fecc0 into singularityhub:master Dec 3, 2021
@vsoch
Copy link
Member

vsoch commented Dec 3, 2021

Thank you!

https://pypi.org/project/singularity-compose/0.1.15/

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

Successfully merging this pull request may close these issues.

2 participants