Skip to content

Conversation

@PauloMigAlmeida
Copy link
Contributor

Bind volumes didn't take into account situations in which they might be located in user's home directory. While in production clusters this isn't very common, for dev workstations this sometimes can be useful.

Config:

version: '2.0'
instances:

  database:
    build:
      context: .
      recipe: ./recipes/postgres/main.def
      options:
        - fakeroot
    start:
      options:
        - containall
    network:
      enable: false
    volumes:
      - ./recipes/postgres/env.sh:/.singularity.d/env/env.sh
      - ./volumes/postgres/conf:/opt/bitnami/postgresql/conf
      - ./volumes/postgres/tmp:/opt/bitnami/postgresql/tmp
      - ~/postgres_data:/bitnami/postgresql

Before:

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

Building database
singularity build --fakeroot /home/almeidarodenaspm/workspace/prefect-monorepo/singularity/database.sif ./recipes/postgres/main.def
Creating database

ERROR bind source file ~/postgres_data does not exist

Now:

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

Creating database
DEBUG singularity instance start --bind /home/almeidarodenaspm/workspace/prefect-monorepo/singularity/recipes/postgres/env.sh:/.singularity.d/env/env.sh --bind /home/almeidarodenaspm/workspace/prefect-monorepo/singularity/volumes/postgres/conf:/opt/bitnami/postgresql/conf --bind /home/almeidarodenaspm/workspace/prefect-monorepo/singularity/volumes/postgres/tmp:/opt/bitnami/postgresql/tmp --bind /home/almeidarodenaspm/postgres_data:/bitnami/postgresql --bind /home/almeidarodenaspm/workspace/prefect-monorepo/singularity/resolv.conf:/etc/resolv.conf --bind /home/almeidarodenaspm/workspace/prefect-monorepo/singularity/etc.hosts:/etc/hosts --hostname database --writable-tmpfs /home/almeidarodenaspm/workspace/prefect-monorepo/singularity/database.sif database 
postgresql 14:19:06.37 
postgresql 14:19:06.37 Welcome to the Bitnami postgresql container
.......

@vsoch
Copy link
Member

vsoch commented Dec 1, 2021

Your PRs are flawless @PauloMigAlmeida ! Can you point me to where the orb is misbehaving (or is that no longer an issue?)

@PauloMigAlmeida
Copy link
Contributor Author

Ignore my comment about the orb, the CircleCI job probably had a hiccup and I jumped to conclusions too soon. Looks like the last job execution succeeded so it's good to go :)

@vsoch vsoch merged commit eae9eb4 into singularityhub:master Dec 1, 2021
@vsoch
Copy link
Member

vsoch commented Dec 1, 2021

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

Thank you! I love your PRs they are so easy to approve :)

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