<commit_before>#!/bin/sh

domain=local.wholetale.org
role=manager,celery
image=wholetale/gwvolman:latest
registry_user=fido
registry_pass=<PASSWORD>

sudo umount /usr/local/lib > /dev/null 2>&1 || true
docker stop -t 0 celery_worker >/dev/null 2>&1
docker rm celery_worker > /dev/null 2>&1

# docker pull ${image} > /dev/null 2>&1
# Do not set GIRDER_API_URL for celery_worker it's handled elsewhere for local deployment
# See my comment: https://github.com/whole-tale/deploy-dev/issues/10#issuecomment-451193663

docker run \
    --name celery_worker \
    --label traefik.enable=false \
    -e HOSTDIR=/host \
    -e DOMAIN=${domain} \
    -e TRAEFIK_NETWORK=wt_traefik-net \
    -e TRAEFIK_ENTRYPOINT=https \
    -e REGISTRY_USER=${registry_user} \
    -e REGISTRY_URL=https://registry.${domain} \
    -e REGISTRY_PASS=${registry_pass} \
    -v /var/run/docker.sock:/var/run/docker.sock:ro \
    -v /:/host \
    -v /var/cache/davfs2:/var/cache/davfs2 \
    -v /run/mount.davfs:/run/mount.davfs \
    -v $PWD/src/gwvolman:/gwvolman \
    --device /dev/fuse \
    --cap-add SYS_ADMIN \
    --cap-add SYS_PTRACE \
    --security-opt apparmor:unconfined \
    --network wt_celery \
    -d ${image} \
      -Q ${role},$(docker info --format "{{.Swarm.NodeID}}") \
      --hostname=$(docker info --format "{{.Swarm.NodeID}}")

docker exec -ti celery_worker chown davfs2:davfs2 /host/run/mount.davfs
docker exec -ti celery_worker chown davfs2:davfs2 /host/var/cache/davfs2
<commit_msg>Explicitly set concurency to 3, so that we avoid deadlock on single cpu machines<commit_after>#!/bin/sh

domain=local.wholetale.org
role=manager,celery
image=wholetale/gwvolman:latest
registry_user=fido
registry_pass=<PASSWORD>

sudo umount /usr/local/lib > /dev/null 2>&1 || true
docker stop -t 0 celery_worker >/dev/null 2>&1
docker rm celery_worker > /dev/null 2>&1

# docker pull ${image} > /dev/null 2>&1
# Do not set GIRDER_API_URL for celery_worker it's handled elsewhere for local deployment
# See my comment: https://github.com/whole-tale/deploy-dev/issues/10#issuecomment-451193663

docker run \
    --name celery_worker \
    --label traefik.enable=false \
    -e HOSTDIR=/host \
    -e DOMAIN=${domain} \
    -e TRAEFIK_NETWORK=wt_traefik-net \
    -e TRAEFIK_ENTRYPOINT=https \
    -e REGISTRY_USER=${registry_user} \
    -e REGISTRY_URL=https://registry.${domain} \
    -e REGISTRY_PASS=${registry_pass} \
    -v /var/run/docker.sock:/var/run/docker.sock:ro \
    -v /:/host \
    -v /var/cache/davfs2:/var/cache/davfs2 \
    -v /run/mount.davfs:/run/mount.davfs \
    -v $PWD/src/gwvolman:/gwvolman \
    --device /dev/fuse \
    --cap-add SYS_ADMIN \
    --cap-add SYS_PTRACE \
    --security-opt apparmor:unconfined \
    --network wt_celery \
    -d ${image} \
      -Q ${role},$(docker info --format "{{.Swarm.NodeID}}") \
      --hostname=$(docker info --format "{{.Swarm.NodeID}}") \
      -c 3

docker exec -ti celery_worker chown davfs2:davfs2 /host/run/mount.davfs
docker exec -ti celery_worker chown davfs2:davfs2 /host/var/cache/davfs2

{'fraction_non_alphanumeric': 0.15078843626806834, 'fraction_numerical': 0.018396846254927726, 'mean_word_length': 2.9908256880733943, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '292637', 'n_tokens_mistral': 1258, 'n_tokens_neox': 1153, 'n_words': 235}