Skip to content

Commit 0909583

Browse files
Merge pull request ietf-tools#8966 from jennifer-richards/remove-celery-image
chore(dev): remove the datatracker-celery image
1 parent 1eff7d1 commit 0909583

6 files changed

Lines changed: 12 additions & 133 deletions

File tree

.github/workflows/build-celery-worker.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

dev/celery/Dockerfile

Lines changed: 0 additions & 23 deletions
This file was deleted.

dev/deploy-to-container/cli.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ async function main () {
7070
.replace('__HOSTNAME__', hostname)
7171
)
7272
await fs.copy(path.join(basePath, 'docker/scripts/app-create-dirs.sh'), path.join(releasePath, 'app-create-dirs.sh'))
73+
await fs.copy(path.join(basePath, 'docker/scripts/app-init-celery.sh'), path.join(releasePath, 'app-init-celery.sh'))
7374
await fs.copy(path.join(basePath, 'dev/deploy-to-container/start.sh'), path.join(releasePath, 'start.sh'))
7475
await fs.copy(path.join(basePath, 'test/data'), path.join(releasePath, 'test/data'))
7576
console.info('Updated configuration files.')
@@ -98,14 +99,6 @@ async function main () {
9899
})
99100
console.info('Pulled latest MQ docker image.')
100101

101-
// Pull latest Celery image
102-
console.info('Pulling latest Celery docker image...')
103-
const celeryImagePullStream = await dock.pull('ghcr.io/ietf-tools/datatracker-celery:latest')
104-
await new Promise((resolve, reject) => {
105-
dock.modem.followProgress(celeryImagePullStream, (err, res) => err ? reject(err) : resolve(res))
106-
})
107-
console.info('Pulled latest Celery docker image.')
108-
109102
// Terminate existing containers
110103
console.info('Ensuring existing containers with same name are terminated...')
111104
const containers = await dock.listContainers({ all: true })
@@ -221,7 +214,7 @@ async function main () {
221214
const celeryContainers = {}
222215
for (const conConf of conConfs) {
223216
celeryContainers[conConf.name] = await dock.createContainer({
224-
Image: 'ghcr.io/ietf-tools/datatracker-celery:latest',
217+
Image: 'ghcr.io/ietf-tools/datatracker-app-base:latest',
225218
name: `dt-${conConf.name}-${branch}`,
226219
Hostname: `dt-${conConf.name}-${branch}`,
227220
Env: [
@@ -243,7 +236,7 @@ async function main () {
243236
Name: 'unless-stopped'
244237
}
245238
},
246-
Cmd: ['--loglevel=INFO']
239+
Entrypoint: ['bash', '-c', 'chmod +x ./app-init-celery.sh && ./app-init-celery.sh']
247240
})
248241
}
249242
console.info('Created Celery docker containers successfully.')

docker/celery.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/ietf-tools/datatracker-celery:latest
1+
FROM ghcr.io/ietf-tools/datatracker-app-base:latest
22
LABEL maintainer="IETF Tools Team <tools-discuss@ietf.org>"
33

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

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

docker/docker-compose.celery.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,22 @@ if [[ "${CELERY_ROLE}" == "worker" ]]; then
9090
run_as_celery_uid /usr/local/bin/python $WORKSPACEDIR/ietf/manage.py check
9191
fi
9292

93+
USER_BIN_PATH="/home/dev/.local/bin"
94+
WATCHMEDO="$USER_BIN_PATH/watchmedo"
95+
CELERY="$USER_BIN_PATH/celery"
9396
trap 'trap "" TERM; cleanup' TERM
9497
# start celery in the background so we can trap the TERM signal
95-
if [[ -n "${DEV_MODE}" ]]; then
96-
watchmedo auto-restart \
98+
if [[ -n "${DEV_MODE}" && -x "${WATCHMEDO}" ]]; then
99+
$WATCHMEDO auto-restart \
97100
--patterns '*.py' \
98101
--directory 'ietf' \
99102
--recursive \
100103
--debounce-interval 5 \
101104
-- \
102-
celery --app="${CELERY_APP:-ietf}" "${CELERY_OPTS[@]}" $@ &
105+
$CELERY --app="${CELERY_APP:-ietf}" "${CELERY_OPTS[@]}" $@ &
103106
celery_pid=$!
104107
else
105-
celery --app="${CELERY_APP:-ietf}" "${CELERY_OPTS[@]}" "$@" &
108+
$CELERY --app="${CELERY_APP:-ietf}" "${CELERY_OPTS[@]}" "$@" &
106109
celery_pid=$!
107110
fi
108111

0 commit comments

Comments
 (0)