Skip to content

Commit

Permalink
set WORKER_COUNT=1 when starting quay with Sqlite
Browse files Browse the repository at this point in the history
without this, multiple workers tend to write simultaneously
causing concurrent write issues
  • Loading branch information
harishsurf committed Jun 13, 2024
1 parent 7bf9502 commit 5927d2a
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 133 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@

- name: Loading Quay if quay.tar exists
shell:
cmd: podman image import --change 'ENV container=oci' --change 'ENV PATH=/app/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' --change 'ENV PYTHONUNBUFFERED=1' --change 'ENV PYTHONIOENCODING=UTF-8' --change 'ENV LC_ALL=C.UTF-8' --change 'ENV LANG=C.UTF-8' --change 'ENV QUAYDIR=/quay-registry' --change 'ENV QUAYCONF=/quay-registry/conf' --change 'ENV QUAYRUN=/quay-registry/conf' --change 'ENV QUAYPATH=/quay-registry' --change 'ENV PYTHONUSERBASE=/app' --change 'ENV PYTHONPATH=/quay-registry' --change 'ENV TZ=UTC' --change 'ENV RED_HAT_QUAY=true' --change 'ENTRYPOINT=["dumb-init","--","/quay-registry/quay-entrypoint.sh"]' --change 'WORKDIR=/quay-registry' --change 'EXPOSE=7443' --change 'EXPOSE=8080' --change 'EXPOSE=8443' --change 'VOLUME=/conf/stack' --change 'VOLUME=/datastorage' --change 'VOLUME=/sqlite/data' --change 'VOLUME=/tmp' --change 'VOLUME=/var/log' --change 'USER=1001' --change 'CMD ["registry"]' - {{ quay_image }} < {{ quay_root }}/quay.tar
cmd: podman image import --change 'ENV container=oci' --change 'ENV PATH=/app/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' --change 'ENV PYTHONUNBUFFERED=1' --change 'ENV PYTHONIOENCODING=UTF-8' --change 'ENV LC_ALL=C.UTF-8' --change 'ENV LANG=C.UTF-8' --change 'ENV QUAYDIR=/quay-registry' --change 'ENV QUAYCONF=/quay-registry/conf' --change 'ENV QUAYRUN=/quay-registry/conf' --change 'ENV QUAYPATH=/quay-registry' --change 'ENV PYTHONUSERBASE=/app' --change 'ENV PYTHONPATH=/quay-registry' --change 'ENV TZ=UTC' --change 'ENV RED_HAT_QUAY=true' --change 'ENTRYPOINT=["dumb-init","--","/quay-registry/quay-entrypoint.sh"]' --change 'WORKDIR=/quay-registry' --change 'EXPOSE=7443' --change 'EXPOSE=8080' --change 'EXPOSE=8443' --change 'VOLUME=/conf/stack' --change 'VOLUME=/datastorage' --change 'VOLUME=/sqlite' --change 'VOLUME=/tmp' --change 'VOLUME=/var/log' --change 'USER=1001' --change 'CMD ["registry"]' - {{ quay_image }} < {{ quay_root }}/quay.tar
when: p.stat.exists and local_install == "false"
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
- name: Create Sqlite Storage named volume
containers.podman.podman_volume:
state: present
name: "{{ sqlite_storage }}"
name: sqlite-storage

- name: Start Quay service
systemd:
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@
- name: Set facts for the pre-existing secrets only if they are a string and not a jinja2 variable in the config.yaml.
ansible.builtin.set_fact:
REDIS_PASSWORD : "{{ quay_config_file['USER_EVENTS_REDIS']['password'] }}"
PGDB_PASSWORD : "{{ quay_config_file['DB_URI'].split('@')[0].split(':')[2] }}"
when: quay_config_file['DATABASE_SECRET_KEY'] is string and quay_config_file['USER_EVENTS_REDIS']['password'] is string and quay_config_file['DB_URI'] is string

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
- name: Set SELinux Rules
include_tasks: set-selinux-rules.yaml

- name: Autodetect root or rootless from previous install
include_tasks: migrate-pre-1_3_0.yaml

- name: Autodetect Image Archive
include_tasks: autodetect-image-archive.yaml

Expand All @@ -19,9 +16,6 @@
- name: Upgrade Quay Pod Service
include_tasks: upgrade-pod-service.yaml

- name: Upgrade Postgres Service
include_tasks: upgrade-postgres-service.yaml

- name: Upgrade Redis Service
include_tasks: upgrade-redis-service.yaml

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@
- name: Fail the playbook due to Quay not becoming alive
fail:
msg: "Quay did not become alive. Check debug logs above for details."

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ ExecStart=/usr/bin/podman run \
--cidfile %t/%n-cid \
--cgroups=no-conmon \
--replace \
-e WORKER_COUNT_UNSUPPORTED_MINIMUM=1 \
-e WORKER_COUNT=1 \
{{ quay_image }}

ExecStop=-/usr/bin/podman stop --ignore --cidfile %t/%n-cid -t 10
Expand Down
2 changes: 1 addition & 1 deletion cmd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ func getImageMetadata(app, imageName, archivePath string) string {
--change 'EXPOSE=8443' \
--change 'VOLUME=/conf/stack' \
--change 'VOLUME=/datastorage' \
--change 'VOLUME=/sqlite/data' \
--change 'VOLUME=/sqlite' \
--change 'VOLUME=/tmp' \
--change 'VOLUME=/var/log' \
--change 'USER=1001' \
Expand Down

0 comments on commit 5927d2a

Please sign in to comment.