Skip to content

Commit 69f6373

Browse files
bug 1597598 - use taskgraph (#226)
* bug 1597598 - use taskgraph * add pr kind * address review comments * add tox to pr kind-dependencies * dict comprehension * don't pre-hash digest-extra; don't set empty `cached_task` attribute * digest-paths, using hash_paths * digest-paths -> resources * script_name transform * pushsnapscript - shared setup script * env.update * pushflatpakscript - shared setup script * pushapkscript - shared setup script * _resolve_replace_string * add parameters. still need to add target tasks method * cache type * label * remove tox artifacts dir for now * explicit docker-image dep for tox * target tasks * parameters['docker_tag'] * docker-image py3{7,8} -> python3{7,8} * push_docker_image param * Update taskcluster/docker/k8s-image/Dockerfile Co-authored-by: Johan Lorenzo <jlorenzo@mozilla.com> * add comment to pushsnapscript/Dockerfile * rm chmod from pushsnapscript tox Dockerfile * Update taskcluster/scriptworker_taskgraph/parameters.py Co-authored-by: Johan Lorenzo <jlorenzo@mozilla.com> * remove unused repo_name * address resources review comments * fix * adjust checks * remove skip_on_project_specific_branches Co-authored-by: Johan Lorenzo <jlorenzo@mozilla.com>
1 parent 78f66cb commit 69f6373

File tree

33 files changed

+1071
-273
lines changed

33 files changed

+1071
-273
lines changed

.taskcluster.yml

Lines changed: 245 additions & 201 deletions
Large diffs are not rendered by default.

docker.d/generate_version_json.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#/bin/sh
22
set -e
33

4-
test $GIT_HEAD_REV
4+
test $HEAD_REV
55
test $TASK_ID
66
test $TASKCLUSTER_ROOT_URL
77
test $REPO_URL

docker.d/push_image.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ test $DOCKERHUB_EMAIL
55
test $DOCKERHUB_USER
66
test $DOCKER_REPO
77
test $DOCKER_TAG
8-
test $GIT_HEAD_REV
8+
test $HEAD_REV
9+
test $HOME
910
test $PUSH_DOCKER_IMAGE
1011
test $SECRET_URL
1112
test $PROJECT_NAME
@@ -18,12 +19,12 @@ docker tag $DOCKER_REPO:$DOCKER_TAG $DOCKER_REPO:$DOCKER_ARCHIVE_TAG
1819

1920
echo "=== Generating dockercfg ==="
2021
# docker login stopped working in Taskcluster for some reason
21-
wget -qO- $SECRET_URL | jq '.secret.docker.dockercfg' > /root/.dockercfg
22-
chmod 600 /root/.dockercfg
22+
wget -qO- $SECRET_URL | jq '.secret.docker.dockercfg' > $HOME/.dockercfg
23+
chmod 600 $HOME/.dockercfg
2324

2425
echo "=== Pushing to docker hub ==="
2526
docker push $DOCKER_REPO:$DOCKER_TAG
2627
docker push $DOCKER_REPO:$DOCKER_ARCHIVE_TAG
2728

2829
echo "=== Clean up ==="
29-
rm -f /root/.dockercfg
30+
rm -f $HOME/.dockercfg

pushapkscript/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ FROM python:3.8
33
RUN groupadd --gid 10001 app && \
44
useradd -g app --uid 10001 --shell /usr/sbin/nologin --create-home --home-dir /app app
55

6-
RUN apt-get update \
7-
&& apt-get install -y default-jdk \
8-
&& apt-get clean \
9-
&& ln -s /app/docker.d/healthcheck /bin/healthcheck
6+
RUN ln -s /app/docker.d/healthcheck /bin/healthcheck
107

11-
USER app
128
WORKDIR /app
139

1410
COPY . /app
1511

12+
RUN /app/docker.d/image_setup.sh
13+
14+
USER app
15+
1616
RUN python -m venv /app \
1717
&& cd pushapkscript \
1818
&& /app/bin/pip install -r requirements/base.txt \

pushapkscript/Dockerfile.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ ARG PYTHON_VERSION
22

33
FROM python:${PYTHON_VERSION}
44

5-
RUN apt-get update && apt-get install -y default-jdk && apt-get clean
6-
75
WORKDIR /app
86

97
COPY MANIFEST.in setup.py tox.ini /app/
108
COPY requirements/ /app/requirements/
9+
COPY docker.d/image_setup.sh /app/
10+
RUN /app/image_setup.sh
1111

1212
RUN pip install -r requirements/local.txt
1313

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
set -o errexit -o pipefail
3+
4+
apt-get update
5+
apt-get install -y default-jdk
6+
apt-get clean

pushflatpakscript/Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@ FROM python:3.8
33
RUN groupadd --gid 10001 app && \
44
useradd -g app --uid 10001 --shell /usr/sbin/nologin --create-home --home-dir /app app
55

6-
RUN apt-get update \
7-
&& apt-get install -y gir1.2-ostree-1.0 libgirepository1.0-dev \
8-
&& apt-get clean \
9-
&& ln -s /app/docker.d/healthcheck /bin/healthcheck
6+
RUN ln -s /app/docker.d/healthcheck /bin/healthcheck
107

11-
USER app
128
WORKDIR /app
13-
149
COPY . /app
1510

11+
RUN /app/docker.d/image_setup.sh
12+
13+
USER app
14+
1615
RUN python -m venv /app \
1716
&& cd pushflatpakscript \
1817
&& /app/bin/pip install -r requirements/base.txt \

pushflatpakscript/Dockerfile.test

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ ARG PYTHON_VERSION
22

33
FROM python:${PYTHON_VERSION}
44

5-
RUN apt-get update \
6-
&& apt-get install -y gir1.2-ostree-1.0 libgirepository1.0-dev
7-
85
WORKDIR /app
96

7+
COPY docker.d/image_setup.sh /app/
8+
9+
RUN /app/image_setup.sh
10+
1011
COPY MANIFEST.in setup.py tox.ini /app/
1112
COPY requirements/ /app/requirements/
1213

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
set -o errexit -o pipefail
3+
4+
apt-get update
5+
apt-get install -y gir1.2-ostree-1.0 libgirepository1.0-dev
6+
apt-get clean

pushsnapscript/Dockerfile

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,16 @@ FROM python:3.8
33
RUN groupadd --gid 10001 app && \
44
useradd -g app --uid 10001 --shell /usr/sbin/nologin --create-home --home-dir /app app
55

6-
RUN apt-get update \
7-
&& apt-get install -y libsodium-dev \
8-
&& apt-get install -y squashfs-tools \
9-
&& apt-get install -y xdelta3 \
10-
&& apt-get clean \
11-
# XXX Avoid snapcraft from loading useless libs when running on Ubuntu
12-
&& truncate -s 0 /etc/os-release \
13-
&& ln -s /app/docker.d/healthcheck /bin/healthcheck
6+
RUN ln -s /app/docker.d/healthcheck /bin/healthcheck
147

15-
USER app
168
WORKDIR /app
17-
189
COPY . /app
1910

11+
# Production image requires extra packages
12+
RUN /app/docker.d/image_setup.sh libsodium-dev squashfs-tools xdelta3
13+
14+
USER app
15+
2016
RUN python -m venv /app \
2117
&& cd pushsnapscript \
2218
&& /app/bin/pip install -r requirements/base.txt \

0 commit comments

Comments
 (0)