Mohammed Naser | aa48ddb | 2023-12-30 00:11:22 -0500 | [diff] [blame] | 1 | VERSION 0.7 |
| 2 | |
Mohammed Naser | 403c042 | 2024-01-16 14:36:28 -0500 | [diff] [blame] | 3 | PIP_INSTALL: |
| 4 | COMMAND |
| 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: |
| 12 | COMMAND |
| 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: |
| 27 | COMMAND |
| 28 | ARG PROJECT |
| 29 | ARG PROJECT_REF |
| 30 | DO +GIT_CHECKOUT --PROJECT=${PROJECT} --PROJECT_REF=${PROJECT_REF} |
| 31 | ARG EXTRAS="" |
| 32 | ARG PIP_PACKAGES="" |
| 33 | DO +PIP_INSTALL --PACKAGES "/src${EXTRAS} ${PIP_PACKAGES}" |
| 34 | SAVE ARTIFACT /var/lib/openstack venv |
| 35 | |
| 36 | requirements: |
| 37 | FROM ../base+image |
| 38 | ARG RELEASE |
| 39 | COPY ${RELEASE}/upper-constraints.txt /upper-constraints.txt |
| 40 | SAVE ARTIFACT /upper-constraints.txt |
| 41 | |
| 42 | builder: |
Mohammed Naser | c639230 | 2024-01-04 00:43:02 -0500 | [diff] [blame] | 43 | ARG RELEASE |
| 44 | FROM ../cloud-archive-base+image --RELEASE=${RELEASE} |
| 45 | DO ../+APT_INSTALL --PACKAGES "\ |
| 46 | build-essential \ |
| 47 | curl \ |
| 48 | git \ |
| 49 | libldap2-dev \ |
| 50 | libpcre3-dev \ |
| 51 | libsasl2-dev \ |
| 52 | libssl-dev \ |
| 53 | lsb-release \ |
| 54 | openssh-client \ |
| 55 | python3 \ |
| 56 | python3-dev \ |
| 57 | python3-pip \ |
| 58 | python3-venv" |
| 59 | RUN --mount type=cache,target=/root/.cache \ |
| 60 | python3 -m venv --upgrade --system-site-packages /var/lib/openstack |
Mohammed Naser | 403c042 | 2024-01-16 14:36:28 -0500 | [diff] [blame] | 61 | COPY \ |
| 62 | (+requirements/upper-constraints.txt --RELEASE=${RELEASE}) \ |
| 63 | /upper-constraints.txt |
| 64 | DO +PIP_INSTALL --PACKAGES "pymysql python-memcached cryptography uwsgi" |
Mohammed Naser | c639230 | 2024-01-04 00:43:02 -0500 | [diff] [blame] | 65 | |
Mohammed Naser | aa48ddb | 2023-12-30 00:11:22 -0500 | [diff] [blame] | 66 | image: |
Mohammed Naser | 403c042 | 2024-01-16 14:36:28 -0500 | [diff] [blame] | 67 | ARG --required RELEASE |
Mohammed Naser | aa48ddb | 2023-12-30 00:11:22 -0500 | [diff] [blame] | 68 | FROM ../cloud-archive-base+image --RELEASE=${RELEASE} |
Mohammed Naser | aa48ddb | 2023-12-30 00:11:22 -0500 | [diff] [blame] | 69 | ENV PATH=/var/lib/openstack/bin:$PATH |
Mohammed Naser | 403c042 | 2024-01-16 14:36:28 -0500 | [diff] [blame] | 70 | ARG --required PROJECT |
| 71 | DO ../+CREATE_PROJECT_USER --PROJECT=${PROJECT} |