Skip to content

Commit

Permalink
backend, dist-git: rename dispatcher scripts
Browse files Browse the repository at this point in the history
A hurdle when trying to stand-up a simple single-machine Copr
deployment is that both the copr-backend and copr-dist-git packages
install a script to /usr/bin/copr-run-dispatcher, preventing the user
from asking that both be installed on the same system with dnf.

This commit renames the script from backend and dist-git to
copr-run-dispatcher-backend and copr-run-dispatcher-dist-git
respectively.

Fixes fedora-copr#3007.
  • Loading branch information
Bob131 authored and praiskup committed Dec 11, 2023
1 parent a87d540 commit fb58083
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion backend/units/copr-backend-action.service
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Wants=logrotate.timer
Type=simple
User=copr
Group=copr
ExecStart=/usr/bin/copr-run-dispatcher actions
ExecStart=/usr/bin/copr-run-dispatcher-backend actions
# we don't want to kill background action processors (daemoncontext)
KillMode=process
Restart=on-failure
Expand Down
2 changes: 1 addition & 1 deletion backend/units/copr-backend-build.service
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Wants=logrotate.timer
Type=simple
User=copr
Group=copr
ExecStart=/usr/bin/copr-run-dispatcher builds
ExecStart=/usr/bin/copr-run-dispatcher-backend builds
# we don't want to kill background action processors (daemoncontext)
KillMode=process
Restart=on-failure
Expand Down
2 changes: 1 addition & 1 deletion dist-git/copr-dist-git.service
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Wants=logrotate.timer
User=copr-dist-git
Group=packager
AmbientCapabilities=CAP_SETGID
ExecStart=/usr/bin/copr-run-dispatcher imports
ExecStart=/usr/bin/copr-run-dispatcher-dist-git imports
KillMode=process
Restart=on-failure

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions docker-compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ services:
backend-build:
environment:
- PYTHONPATH=/opt/copr/backend
command: /usr/sbin/runuser -u copr -g copr -- /usr/bin/copr-run-dispatcher builds
command: /usr/sbin/runuser -u copr -g copr -- /usr/bin/copr-run-dispatcher-backend builds

backend-action:
environment:
- PYTHONPATH=/opt/copr/backend
command: /usr/sbin/runuser -u copr -g copr -- /usr/bin/copr-run-dispatcher actions
command: /usr/sbin/runuser -u copr -g copr -- /usr/bin/copr-run-dispatcher-backend actions

frontend:
environment:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ services:
build:
context: docker/backend
hostname: backend-build
command: ["/run-backend", "--sign-host", "keygen-signd", "/usr/bin/copr-run-dispatcher", "builds"]
command: ["/run-backend", "--sign-host", "keygen-signd", "/usr/bin/copr-run-dispatcher-backend", "builds"]
depends_on:
- backend-log
- resalloc
Expand All @@ -48,7 +48,7 @@ services:
build:
context: docker/backend
hostname: backend-action
command: ["/run-backend", "--sign-host", "keygen-signd", "/usr/bin/copr-run-dispatcher", "actions"]
command: ["/run-backend", "--sign-host", "keygen-signd", "/usr/bin/copr-run-dispatcher-backend", "actions"]
depends_on:
- backend-log
- resalloc
Expand Down
2 changes: 1 addition & 1 deletion docker/distgit/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ RUN directories="/etc/httpd /var/run/httpd /var/log/httpd /var/lib/dist-git /run
USER copr-dist-git

ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["bash", "-c", "mkdir -p /var/lib/dist-git/cache /var/lib/dist-git/git && exec /usr/bin/copr-run-dispatcher imports"]
CMD ["bash", "-c", "mkdir -p /var/lib/dist-git/cache /var/lib/dist-git/git && exec /usr/bin/copr-run-dispatcher-dist-git imports"]
4 changes: 2 additions & 2 deletions kubernetes/kustomize/backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ spec:
- image: copr_backend-action:latest
imagePullPolicy: Always
name: action
command: ["/tini", "--", "/usr/sbin/runuser", "-u", "copr", "-g", "copr", "--", "/usr/bin/copr-run-dispatcher", "actions"]
command: ["/tini", "--", "/usr/sbin/runuser", "-u", "copr", "-g", "copr", "--", "/usr/bin/copr-run-dispatcher-dist-git", "actions"]
resources:
requests:
cpu: 200m
Expand All @@ -86,7 +86,7 @@ spec:
- image: copr_backend-build:latest
imagePullPolicy: Always
name: build
command: ["/tini", "--", "/usr/sbin/runuser", "-u", "copr", "-g", "copr","-G", "obsrun", "--", "/usr/bin/copr-run-dispatcher", "builds"]
command: ["/tini", "--", "/usr/sbin/runuser", "-u", "copr", "-g", "copr","-G", "obsrun", "--", "/usr/bin/copr-run-dispatcher-backend", "builds"]
resources:
requests:
cpu: 200m
Expand Down
4 changes: 2 additions & 2 deletions openshift/services/backend.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ spec:
- name: locks
mountPath: /var/lock/copr-backend
command: ["/usr/bin/tini", "--"]
args: ["/run-backend", "--sign-host", "copr-keygen", "/usr/bin/copr-run-dispatcher", "actions"]
args: ["/run-backend", "--sign-host", "copr-keygen", "/usr/bin/copr-run-dispatcher-backend", "actions"]

- name: builds
image: "{{ copr_backend_image }}"
Expand All @@ -156,7 +156,7 @@ spec:
- name: HOME
value: /backend-home
command: ["/usr/bin/tini", "--"]
args: ["/run-backend", "--sign-host", "copr-keygen", "/usr/bin/copr-run-dispatcher", "builds"]
args: ["/run-backend", "--sign-host", "copr-keygen", "/usr/bin/copr-run-dispatcher-backend", "builds"]

# start these containers on the same node with copr-backend-httpd!
affinity:
Expand Down

0 comments on commit fb58083

Please sign in to comment.