Skip to content
New issue

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

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

Already on GitHub? # to your account

podlet compose --pod doesn't prepend requires with pod name #114

Closed
sugoidogo opened this issue Sep 29, 2024 · 1 comment · Fixed by #115
Closed

podlet compose --pod doesn't prepend requires with pod name #114

sugoidogo opened this issue Sep 29, 2024 · 1 comment · Fixed by #115
Labels
bug Something isn't working
Milestone

Comments

@sugoidogo
Copy link

I was using podlet to convert glitchtip's docker-compose file to a pod and found that the requires options weren't prepended with the pod name the same way that the container file names were. I had to make other changes to their compose file since they were taking advantage of the docker extension syntax to define their common options, so I've also included my edited version of the compose file to make it podlet-compatible.

[root@digitalocean ~]# cat glitchtip.yml
name: glitchtip
services:
  postgres:
    image: postgres:16
    environment:
      POSTGRES_HOST_AUTH_METHOD: "trust"  # Consider removing this and setting a password
    #restart: unless-stopped
    volumes:
      - /etc/glitchtip/pg-data:/var/lib/postgresql/data
  redis:
    image: redis
    #restart: unless-stopped
  web:
    image: glitchtip/glitchtip
    depends_on: &default-depends_on
      - postgres
      - redis
    ports:
      - "8000:8000"
    environment: &default-environment
      DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres
      SECRET_KEY: change_me_to_something_random # best to run openssl rand -hex 32
      PORT: 8000
      EMAIL_URL: consolemail:// # Example smtp://email:password@smtp_url:port https://glitchtip.com/documentation/install#c>  EMAIL_BACKEND: anymail.backends.mailjet.EmailBackend
      DEFAULT_FROM_EMAIL: email@glitchtip.com # Change this to your email
      CELERY_WORKER_AUTOSCALE: "1,3"  # Scale between 1 and 3 to prevent excessive memory usage. Change it or remove to set>  CELERY_WORKER_MAX_TASKS_PER_CHILD: "10000"
    #restart: unless-stopped
    volumes: &uploads
      - /etc/glitchtip/uploads:/code/uploads
  worker:
    image: glitchtip/glitchtip
    command: ./bin/run-celery-with-beat.sh
    depends_on: *default-depends_on
    environment: *default-environment
    #restart: unless-stopped
    volumes: *uploads
  migrate:
    image: glitchtip/glitchtip
    depends_on: *default-depends_on
    command: ./bin/run-migrate.sh
    environment: *default-environment
[root@digitalocean ~]# podlet compose glitchtip.yml --pod
# glitchtip-postgres.container
[Container]
Environment=POSTGRES_HOST_AUTH_METHOD=trust
Image=postgres:16
Pod=glitchtip.pod
Volume=/etc/glitchtip/pg-data:/var/lib/postgresql/data

---

# glitchtip-redis.container
[Container]
Image=redis
Pod=glitchtip.pod

---

# glitchtip-web.container
[Unit]
Requires=postgres.service redis.service
After=postgres.service redis.service

[Container]
Environment=DATABASE_URL=postgres://postgres:postgres@postgres:5432/postgres SECRET_KEY=change_me_to_something_random PORT=8000 EMAIL_URL=consolemail:// DEFAULT_FROM_EMAIL=email@glitchtip.com CELERY_WORKER_AUTOSCALE=1,3
Image=glitchtip/glitchtip
Pod=glitchtip.pod
Volume=/etc/glitchtip/uploads:/code/uploads

---

# glitchtip-worker.container
[Unit]
Requires=postgres.service redis.service
After=postgres.service redis.service

[Container]
Environment=DATABASE_URL=postgres://postgres:postgres@postgres:5432/postgres SECRET_KEY=change_me_to_something_random PORT=8000 EMAIL_URL=consolemail:// DEFAULT_FROM_EMAIL=email@glitchtip.com CELERY_WORKER_AUTOSCALE=1,3
Exec=./bin/run-celery-with-beat.sh
Image=glitchtip/glitchtip
Pod=glitchtip.pod
Volume=/etc/glitchtip/uploads:/code/uploads

---

# glitchtip-migrate.container
[Unit]
Requires=postgres.service redis.service
After=postgres.service redis.service

[Container]
Environment=DATABASE_URL=postgres://postgres:postgres@postgres:5432/postgres SECRET_KEY=change_me_to_something_random PORT=8000 EMAIL_URL=consolemail:// DEFAULT_FROM_EMAIL=email@glitchtip.com CELERY_WORKER_AUTOSCALE=1,3
Exec=./bin/run-migrate.sh
Image=glitchtip/glitchtip
Pod=glitchtip.pod

---

# glitchtip.pod
[Pod]
PublishPort=8000:8000
@k9withabone
Copy link
Member

Good catch! I'll fix it for the next release. Support for fragments/anchors will also be part of the next release, see #58.

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

Successfully merging a pull request may close this issue.

2 participants