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

[bug] volume not generated #44

Closed
naruse666 opened this issue Dec 12, 2023 · 2 comments
Closed

[bug] volume not generated #44

naruse666 opened this issue Dec 12, 2023 · 2 comments
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@naruse666
Copy link

Describe the bug
I defined a simple volume and generated compose.yaml.
But compose.yaml does not contain volumes.

score.yaml

apiVersion: score.dev/v1b1

metadata:
  name: hello-world
containers:
  awesome-web-service:
    image: busybox
    command: ["/bin/sh"]
    args: ["-c", "while true; do echo Hello!; sleep 100; done"]
    volumes:
    - source: ${resources.tmp-data}
      target: /tmp

resources:
  tmp-data:
    type: volume

generate compose.yaml

score-compose run -f score.yaml -o compose.yaml

compose.yaml

services:
  hello-world:
    command:
      - -c
      - while true; do echo Hello!; sleep 100; done
    entrypoint:
      - /bin/sh
    image: busybox
    volumes:
      - type: volume
        source: tmp-data
        target: /tmp

Expected behavior

services:
  hello-world:
    command:
      - -c
      - while true; do echo Hello!; sleep 100; done
    entrypoint:
      - /bin/sh
    image: busybox
    volumes:
      - type: volume
        source: tmp-data
        target: /tmp
volumes:       # generated this block
  tmp-data:    #

Desktop (please complete the following information):

  • OS: macOS
  • Version [e.g. 1.1.0]

Additional context
I'm a newbie to Score, so my thinking may be wrong.

@naruse666 naruse666 added the bug Something isn't working label Dec 12, 2023
@astromechza
Copy link
Member

Unfortunately score-compose doesn't setup these volumes for you because score cannot predict what kind of volume is needed or how to provision it (which driver, or options).

Instead it relies on you setting up a separate compose.yaml file with the volume:

volumes:
  tmp-data:

And then including that when you run compose up: docker compose -f compose.yaml -f score.compose.yaml up.

We are looking into how we can support this better in the future and how we can pre-provision resources during the compose generation step.

@astromechza
Copy link
Member

I'm going to close this as expected behavior. But we will make this better in the future.

@astromechza astromechza added the wontfix This will not be worked on label Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants