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

fails to launch examples when on a mac #358

Closed
garethahealy opened this issue Nov 18, 2021 · 8 comments
Closed

fails to launch examples when on a mac #358

garethahealy opened this issue Nov 18, 2021 · 8 comments
Labels
bug Something isn't working

Comments

@garethahealy
Copy link

Describe the bug
When running a few examples, I always see errors. I am on a mac so presume it is related to podman machine not supporting mounts yet:

To Reproduce
Steps to reproduce the behavior:

  1. git clone git@github.com:docker/awesome-compose.git
  2. cd awesome-compose/react-java-mysql
  3. podman-compose up -d
  4. see error1

error1

['podman', '--version', '']
using podman version: 3.4.1
Traceback (most recent call last):
  File "/usr/local/bin/podman-compose", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/podman_compose.py", line 1763, in main
    podman_compose.run()
  File "/usr/local/lib/python3.9/site-packages/podman_compose.py", line 1035, in run
    self._parse_compose_file()
  File "/usr/local/lib/python3.9/site-packages/podman_compose.py", line 1129, in _parse_compose_file
    flat_deps(services, with_extends=True)
  File "/usr/local/lib/python3.9/site-packages/podman_compose.py", line 856, in flat_deps
    deps.update(deps_ls)
TypeError: unhashable type: 'dict'
  1. cd ../traefik-golang
  2. podman-compose up -d
  3. see error2
['podman', '--version', '']
using podman version: 3.4.1
** excluding:  set()
['podman', 'inspect', '-t', 'image', '-f', '{{.Id}}', 'traefik-golang_backend']
Error: error inspecting object: unable to inspect "traefik-golang_backend": failed to find image traefik-golang_backend: traefik-golang_backend: image not known
podman build -t traefik-golang_backend -f backend/Dockerfile backend
Error: stat /var/tmp/libpod_builder760979102/build/tmp/awesome-compose/traefik-golang/backend/Dockerfile: no such file or directory

exit code: 125
podman pod create --name=traefik-golang --share net --infra-name=traefik-golang_infra -p 80:80
523af1cb757340040a45017fcdbeeabff21f43c226c5f462e423afcb9a5db22a
exit code: 0
podman run --name=traefik-golang_backend_1 -d --pod=traefik-golang --label traefik.enable=true --label traefik.http.routers.go.rule=Path(`/`) --label traefik.http.services.go.loadbalancer.server.port=80 --label io.podman.compose.config-hash=123 --label io.podman.compose.project=traefik-golang --label io.podman.compose.version=0.0.1 --label com.docker.compose.project=traefik-golang --label com.docker.compose.project.working_dir=/private/tmp/awesome-compose/traefik-golang --label com.docker.compose.project.config_files=docker-compose.yml --label com.docker.compose.container-number=1 --label com.docker.compose.service=backend --add-host frontend:127.0.0.1 --add-host traefik-golang_frontend_1:127.0.0.1 --add-host backend:127.0.0.1 --add-host traefik-golang_backend_1:127.0.0.1 traefik-golang_backend
Error: short-name resolution enforced but cannot prompt without a TTY
exit code: 125
podman start traefik-golang_backend_1
Error: no container with name or ID "traefik-golang_backend_1" found: no such container
exit code: 125
podman run --name=traefik-golang_frontend_1 -d --pod=traefik-golang --label io.podman.compose.config-hash=123 --label io.podman.compose.project=traefik-golang --label io.podman.compose.version=0.0.1 --label com.docker.compose.project=traefik-golang --label com.docker.compose.project.working_dir=/private/tmp/awesome-compose/traefik-golang --label com.docker.compose.project.config_files=docker-compose.yml --label com.docker.compose.container-number=1 --label com.docker.compose.service=frontend -v /var/run/docker.sock:/var/run/docker.sock --add-host frontend:127.0.0.1 --add-host traefik-golang_frontend_1:127.0.0.1 --add-host backend:127.0.0.1 --add-host traefik-golang_backend_1:127.0.0.1 traefik:2.2 --providers.docker --entrypoints.web.address=:80 --providers.docker.exposedbydefault=false
Error: short-name resolution enforced but cannot prompt without a TTY
exit code: 125
podman start traefik-golang_frontend_1
Error: no container with name or ID "traefik-golang_frontend_1" found: no such container
exit code: 125

Expected behavior
It works or the docs call out that Mac as not supported

Actual behavior
It doesn't work

Output

$ podman-compose version
['podman', '--version', '']
using podman version: 3.4.1
podman-composer version  0.1.8
podman --version
podman version 3.4.1
exit code: 0
@garethahealy garethahealy added the bug Something isn't working label Nov 18, 2021
@muayyad-alsadi
Copy link
Collaborator

the yaml contains lines like this

    depends_on:
      db:
        condition: service_healthy

this is currently not supported, change it to

    depends_on:
    - db

@garethahealy
Copy link
Author

@muayyad-alsadi ; is there any docs for what is/isn't supported? as obviously, I am trying to use out-of-the-box docker-compose examples without changes, so if podman-compose isn't read for that, I'll just wait.

@muayyad-alsadi
Copy link
Collaborator

@garethahealy it's supposed to be fixed in the latest 1.x, please upgrade and test.

@garethahealy
Copy link
Author

@muayyad-alsadi ; so the errors have changed to:

podman-compose up -d
['podman', '--version', '']
using podman version: 3.4.4
** excluding:  set()
['podman', 'inspect', '-t', 'image', '-f', '{{.Id}}', 'react-java-mysql_backend']
Error: error inspecting object: unable to inspect "react-java-mysql_backend": failed to find image react-java-mysql_backend: react-java-mysql_backend: image not known
podman build -t react-java-mysql_backend -f backend/Dockerfile backend
Error: stat /var/tmp/libpod_builder316953034/build/tmp/awesome-compose/react-java-mysql/backend/Dockerfile: no such file or directory

exit code: 125

which is related to: containers/podman#8016

@miburke
Copy link

miburke commented Mar 29, 2022

Any update on the service_healthy depends_on feature being implemented in podman-compose? I have the latest devel installed (as of the writing of this) and when using depends_on with a health check, it is not honored. The dependent container is started while the independent container is still in a starting state.

version: "3"
services:
  db:
    image: mariadb
    healthcheck:
      test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
      timeout: 20s
      retries: 10
    volumes:
      - ./mariadb:/var/lib/mysql/data
    environment:
      - MYSQL_DATABASE=${DATABASE_NAME:-testdb}
      - MYSQL_USER=${DATABASE_USER:-testuser}
      - MYSQL_PASSWORD=${DATABASE_PASSWORD:-testpw}
      - MYSQL_ROOT_PASSWORD=password
    ports:
      - "3306:3306"
  app1:
    image: busybox
    command: httpd -f -p 8080 -h /etc/
    depends_on:
      db:
        condition: service_healthy
$ while [ true ]; do podman ps; sleep 3; done
CONTAINER ID  IMAGE       COMMAND     CREATED     STATUS      PORTS       NAMES
CONTAINER ID  IMAGE       COMMAND     CREATED     STATUS      PORTS       NAMES
CONTAINER ID  IMAGE                             COMMAND     CREATED        STATUS                                PORTS                   NAMES
fd99f01f030e  docker.io/library/mariadb:latest  mariadbd    3 seconds ago  Up Less than a second ago (starting)  0.0.0.0:3306->3306/tcp  test-compose_db_1
CONTAINER ID  IMAGE                             COMMAND               CREATED        STATUS                       PORTS                   NAMES
fd99f01f030e  docker.io/library/mariadb:latest  mariadbd              6 seconds ago  Up 3 seconds ago (starting)  0.0.0.0:3306->3306/tcp  test-compose_db_1
c72b53fad7fa  docker.io/library/busybox:latest  httpd -f -p 8080 ...  4 seconds ago  Up 2 seconds ago                                     test-compose_app1_1
CONTAINER ID  IMAGE                             COMMAND               CREATED        STATUS                       PORTS                   NAMES
fd99f01f030e  docker.io/library/mariadb:latest  mariadbd              9 seconds ago  Up 6 seconds ago (starting)  0.0.0.0:3306->3306/tcp  test-compose_db_1
c72b53fad7fa  docker.io/library/busybox:latest  httpd -f -p 8080 ...  8 seconds ago  Up 5 seconds ago                                     test-compose_app1_1

@muayyad-alsadi
Copy link
Collaborator

muayyad-alsadi commented Mar 29, 2022

this is implemented in this pending pull request

#453

I've not merged it yet.

@miburke
Copy link

miburke commented Apr 12, 2022

Do you anticipate PR 453 being merged soon?

@muayyad-alsadi
Copy link
Collaborator

Yes, I would love to merge it. I just need to review it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants