Mohammed Naser | 1220717 | 2024-02-05 18:49:35 -0500 | [diff] [blame] | 1 | VERSION 0.8 |
Mohammed Naser | aa48ddb | 2023-12-30 00:11:22 -0500 | [diff] [blame] | 2 | |
Mohammed Naser | 403c042 | 2024-01-16 14:36:28 -0500 | [diff] [blame] | 3 | PIP_INSTALL: |
Mohammed Naser | 1220717 | 2024-02-05 18:49:35 -0500 | [diff] [blame] | 4 | FUNCTION |
Mohammed Naser | 403c042 | 2024-01-16 14:36:28 -0500 | [diff] [blame] | 5 | ARG PACKAGES |
| 6 | RUN --mount=type=cache,target=/root/.cache \ |
| 7 | /var/lib/openstack/bin/pip3 install \ |
| 8 | --constraint /upper-constraints.txt \ |
| 9 | ${PACKAGES} |
| 10 | |
| 11 | GIT_CHECKOUT: |
Mohammed Naser | 1220717 | 2024-02-05 18:49:35 -0500 | [diff] [blame] | 12 | FUNCTION |
Mohammed Naser | 403c042 | 2024-01-16 14:36:28 -0500 | [diff] [blame] | 13 | ARG PROJECT |
| 14 | ARG PROJECT_REPO=https://github.com/openstack/${PROJECT} |
| 15 | ARG PROJECT_REF |
| 16 | GIT CLONE --branch ${PROJECT_REF} ${PROJECT_REPO} /src |
| 17 | WORKDIR /src |
| 18 | RUN \ |
| 19 | git remote set-url origin ${PROJECT_REPO} && \ |
| 20 | git fetch --unshallow |
| 21 | COPY --if-exists patches/${PROJECT} /patches |
| 22 | IF [ -d /patches ] |
| 23 | RUN git apply --verbose /patches/*.patch |
| 24 | END |
| 25 | |
| 26 | BUILD_VENV: |
Mohammed Naser | 1220717 | 2024-02-05 18:49:35 -0500 | [diff] [blame] | 27 | FUNCTION |
Mohammed Naser | 403c042 | 2024-01-16 14:36:28 -0500 | [diff] [blame] | 28 | ARG PROJECT |
Mohammed Naser | 7a848bc | 2024-01-22 21:58:11 -0500 | [diff] [blame] | 29 | ARG PROJECT_REPO=https://github.com/openstack/${PROJECT} |
Mohammed Naser | 403c042 | 2024-01-16 14:36:28 -0500 | [diff] [blame] | 30 | ARG PROJECT_REF |
Mohammed Naser | 7a848bc | 2024-01-22 21:58:11 -0500 | [diff] [blame] | 31 | DO +GIT_CHECKOUT \ |
| 32 | --PROJECT=${PROJECT} \ |
| 33 | --PROJECT_REPO=${PROJECT_REPO} \ |
| 34 | --PROJECT_REF=${PROJECT_REF} |
Mohammed Naser | 403c042 | 2024-01-16 14:36:28 -0500 | [diff] [blame] | 35 | ARG EXTRAS="" |
| 36 | ARG PIP_PACKAGES="" |
| 37 | DO +PIP_INSTALL --PACKAGES "/src${EXTRAS} ${PIP_PACKAGES}" |
| 38 | SAVE ARTIFACT /var/lib/openstack venv |
| 39 | |
| 40 | requirements: |
| 41 | FROM ../base+image |
| 42 | ARG RELEASE |
Mohammed Naser | 10ab7ef | 2024-01-17 15:23:33 -0500 | [diff] [blame] | 43 | IF [ "${RELEASE}" = "master" ] |
| 44 | ARG BRANCH=master |
| 45 | ELSE |
| 46 | ARG BRANCH=stable/${RELEASE} |
| 47 | END |
| 48 | GIT CLONE --branch ${BRANCH} https://github.com/openstack/requirements /src |
| 49 | RUN \ |
Mohammed Naser | 1dfea6b | 2024-02-09 01:04:26 -0500 | [diff] [blame] | 50 | sed -i 's/cryptography===36.0.2/cryptography===42.0.0/' /src/upper-constraints.txt && \ |
| 51 | sed -i 's/cryptography===40.0.2/cryptography===42.0.0/' /src/upper-constraints.txt && \ |
| 52 | sed -i 's/cryptography===41.0.7/cryptography===42.0.0/' /src/upper-constraints.txt && \ |
| 53 | sed -i 's/Django===3.2.18/Django===3.2.24/' /src/upper-constraints.txt && \ |
Mohammed Naser | 7a848bc | 2024-01-22 21:58:11 -0500 | [diff] [blame] | 54 | sed -i 's/Flask===2.2.3/Flask===2.2.5/' /src/upper-constraints.txt && \ |
Mohammed Naser | b3cefe1 | 2024-01-22 16:36:05 -0500 | [diff] [blame] | 55 | sed -i 's/Jinja2===3.1.2/Jinja2===3.1.3/' /src/upper-constraints.txt && \ |
Mohammed Naser | 7a848bc | 2024-01-22 21:58:11 -0500 | [diff] [blame] | 56 | sed -i 's/paramiko===2.11.0/paramiko===3.4.0/' /src/upper-constraints.txt && \ |
Mohammed Naser | b3cefe1 | 2024-01-22 16:36:05 -0500 | [diff] [blame] | 57 | sed -i 's/paramiko===3.1.0/paramiko===3.4.0/' /src/upper-constraints.txt && \ |
Mohammed Naser | 1dfea6b | 2024-02-09 01:04:26 -0500 | [diff] [blame] | 58 | sed -i 's/pyOpenSSL===22.0.0/pyOpenSSL===24.0.0/' /src/upper-constraints.txt && \ |
| 59 | sed -i 's/pyOpenSSL===23.1.1/pyOpenSSL===24.0.0/' /src/upper-constraints.txt && \ |
Mohammed Naser | 7a848bc | 2024-01-22 21:58:11 -0500 | [diff] [blame] | 60 | sed -i 's/requests===2.28.1/requests===2.31.0/' /src/upper-constraints.txt && \ |
Mohammed Naser | 2142205 | 2024-01-22 15:34:59 -0500 | [diff] [blame] | 61 | sed -i 's/requests===2.28.2/requests===2.31.0/' /src/upper-constraints.txt && \ |
Mohammed Naser | 7a848bc | 2024-01-22 21:58:11 -0500 | [diff] [blame] | 62 | sed -i 's/sqlparse===0.4.2/sqlparse===0.4.4/' /src/upper-constraints.txt && \ |
| 63 | sed -i 's/urllib3===1.26.12/urllib3===1.26.18/' /src/upper-constraints.txt && \ |
Mohammed Naser | 2142205 | 2024-01-22 15:34:59 -0500 | [diff] [blame] | 64 | sed -i 's/urllib3===1.26.15/urllib3===1.26.18/' /src/upper-constraints.txt && \ |
Mohammed Naser | 7a848bc | 2024-01-22 21:58:11 -0500 | [diff] [blame] | 65 | sed -i 's/Werkzeug===2.2.3/Werkzeug===2.3.8/' /src/upper-constraints.txt && \ |
Mohammed Naser | 10ab7ef | 2024-01-17 15:23:33 -0500 | [diff] [blame] | 66 | sed -i '/glance-store/d' /src/upper-constraints.txt && \ |
| 67 | sed -i '/horizon/d' /src/upper-constraints.txt |
Mohammed Naser | 36d353a | 2024-01-17 13:03:05 -0500 | [diff] [blame] | 68 | SAVE ARTIFACT /src/upper-constraints.txt |
Mohammed Naser | 403c042 | 2024-01-16 14:36:28 -0500 | [diff] [blame] | 69 | |
| 70 | builder: |
Mohammed Naser | c639230 | 2024-01-04 00:43:02 -0500 | [diff] [blame] | 71 | ARG RELEASE |
| 72 | FROM ../cloud-archive-base+image --RELEASE=${RELEASE} |
| 73 | DO ../+APT_INSTALL --PACKAGES "\ |
| 74 | build-essential \ |
| 75 | curl \ |
| 76 | git \ |
| 77 | libldap2-dev \ |
| 78 | libpcre3-dev \ |
| 79 | libsasl2-dev \ |
| 80 | libssl-dev \ |
| 81 | lsb-release \ |
| 82 | openssh-client \ |
| 83 | python3 \ |
| 84 | python3-dev \ |
| 85 | python3-pip \ |
| 86 | python3-venv" |
| 87 | RUN --mount type=cache,target=/root/.cache \ |
Mohammed Naser | 2142205 | 2024-01-22 15:34:59 -0500 | [diff] [blame] | 88 | python3 -m venv --upgrade-deps --system-site-packages /var/lib/openstack |
Mohammed Naser | 403c042 | 2024-01-16 14:36:28 -0500 | [diff] [blame] | 89 | COPY \ |
| 90 | (+requirements/upper-constraints.txt --RELEASE=${RELEASE}) \ |
| 91 | /upper-constraints.txt |
Mohammed Naser | a386867 | 2024-01-20 13:54:40 -0500 | [diff] [blame] | 92 | DO +PIP_INSTALL --PACKAGES "cryptography pymysql python-binary-memcached python-memcached uwsgi" |
Mohammed Naser | c639230 | 2024-01-04 00:43:02 -0500 | [diff] [blame] | 93 | |
Mohammed Naser | aa48ddb | 2023-12-30 00:11:22 -0500 | [diff] [blame] | 94 | image: |
Mohammed Naser | 403c042 | 2024-01-16 14:36:28 -0500 | [diff] [blame] | 95 | ARG --required RELEASE |
Mohammed Naser | aa48ddb | 2023-12-30 00:11:22 -0500 | [diff] [blame] | 96 | FROM ../cloud-archive-base+image --RELEASE=${RELEASE} |
Mohammed Naser | aa48ddb | 2023-12-30 00:11:22 -0500 | [diff] [blame] | 97 | ENV PATH=/var/lib/openstack/bin:$PATH |
Mohammed Naser | 403c042 | 2024-01-16 14:36:28 -0500 | [diff] [blame] | 98 | ARG --required PROJECT |
| 99 | DO ../+CREATE_PROJECT_USER --PROJECT=${PROJECT} |