Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 0 additions & 47 deletions .github/workflows/build-celery-worker.yml

This file was deleted.

23 changes: 0 additions & 23 deletions dev/celery/Dockerfile

This file was deleted.

13 changes: 3 additions & 10 deletions dev/deploy-to-container/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ async function main () {
.replace('__HOSTNAME__', hostname)
)
await fs.copy(path.join(basePath, 'docker/scripts/app-create-dirs.sh'), path.join(releasePath, 'app-create-dirs.sh'))
await fs.copy(path.join(basePath, 'docker/scripts/app-init-celery.sh'), path.join(releasePath, 'app-init-celery.sh'))
await fs.copy(path.join(basePath, 'dev/deploy-to-container/start.sh'), path.join(releasePath, 'start.sh'))
await fs.copy(path.join(basePath, 'test/data'), path.join(releasePath, 'test/data'))
console.info('Updated configuration files.')
Expand Down Expand Up @@ -98,14 +99,6 @@ async function main () {
})
console.info('Pulled latest MQ docker image.')

// Pull latest Celery image
console.info('Pulling latest Celery docker image...')
const celeryImagePullStream = await dock.pull('ghcr.io/ietf-tools/datatracker-celery:latest')
await new Promise((resolve, reject) => {
dock.modem.followProgress(celeryImagePullStream, (err, res) => err ? reject(err) : resolve(res))
})
console.info('Pulled latest Celery docker image.')

// Terminate existing containers
console.info('Ensuring existing containers with same name are terminated...')
const containers = await dock.listContainers({ all: true })
Expand Down Expand Up @@ -221,7 +214,7 @@ async function main () {
const celeryContainers = {}
for (const conConf of conConfs) {
celeryContainers[conConf.name] = await dock.createContainer({
Image: 'ghcr.io/ietf-tools/datatracker-celery:latest',
Image: 'ghcr.io/ietf-tools/datatracker-app-base:latest',
name: `dt-${conConf.name}-${branch}`,
Hostname: `dt-${conConf.name}-${branch}`,
Env: [
Expand All @@ -243,7 +236,7 @@ async function main () {
Name: 'unless-stopped'
}
},
Cmd: ['--loglevel=INFO']
Entrypoint: ['bash', '-c', 'chmod +x ./app-init-celery.sh && ./app-init-celery.sh']
})
}
console.info('Created Celery docker containers successfully.')
Expand Down
4 changes: 2 additions & 2 deletions docker/celery.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/ietf-tools/datatracker-celery:latest
FROM ghcr.io/ietf-tools/datatracker-app-base:latest
LABEL maintainer="IETF Tools Team <tools-discuss@ietf.org>"

ENV DEBIAN_FRONTEND=noninteractive
Expand Down Expand Up @@ -34,7 +34,7 @@ RUN bash /tmp/library-scripts/docker-setup-python.sh "none" "/usr/local" "${PIPX
RUN rm -rf /tmp/library-scripts

# Copy the startup file
COPY dev/celery/docker-init.sh /docker-init.sh
COPY docker/scripts/app-init-celery.sh /docker-init.sh
RUN sed -i 's/\r$//' /docker-init.sh && \
chmod +x /docker-init.sh

Expand Down
47 changes: 0 additions & 47 deletions docker/docker-compose.celery.yml

This file was deleted.

11 changes: 7 additions & 4 deletions dev/celery/docker-init.sh → docker/scripts/app-init-celery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,22 @@ if [[ "${CELERY_ROLE}" == "worker" ]]; then
run_as_celery_uid /usr/local/bin/python $WORKSPACEDIR/ietf/manage.py check
fi

USER_BIN_PATH="/home/dev/.local/bin"
WATCHMEDO="$USER_BIN_PATH/watchmedo"
CELERY="$USER_BIN_PATH/celery"
trap 'trap "" TERM; cleanup' TERM
# start celery in the background so we can trap the TERM signal
if [[ -n "${DEV_MODE}" ]]; then
watchmedo auto-restart \
if [[ -n "${DEV_MODE}" && -x "${WATCHMEDO}" ]]; then
$WATCHMEDO auto-restart \
--patterns '*.py' \
--directory 'ietf' \
--recursive \
--debounce-interval 5 \
-- \
celery --app="${CELERY_APP:-ietf}" "${CELERY_OPTS[@]}" $@ &
$CELERY --app="${CELERY_APP:-ietf}" "${CELERY_OPTS[@]}" $@ &
celery_pid=$!
else
celery --app="${CELERY_APP:-ietf}" "${CELERY_OPTS[@]}" "$@" &
$CELERY --app="${CELERY_APP:-ietf}" "${CELERY_OPTS[@]}" "$@" &
celery_pid=$!
fi

Expand Down