Skip to content

fix(cloud-native): resolve failure on sync assets using git #1729

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 21 additions & 20 deletions docker-admin-ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ RUN apk update \
# - use NODE_ENV=production
# - download build package (not git clone)

ENV FLEX_SOURCE_VERSION=b12e9a0bd5c083fd5d6916ca57faf7c5e084484d
ENV FLEX_SOURCE_VERSION=2d580667e5642e594dcc8a91dd5f6d84e3628117
ENV ADMIN_UI_VERSION=${FLEX_SOURCE_VERSION}

RUN mkdir -p /opt/flex /app/templates/admin-ui

# note that as we're pulling from a monorepo (with multiple project in it)
# we are using partial-clone and sparse-checkout to get the admin-ui code
RUN git clone --filter blob:none --no-checkout https://github.com/GluuFederation/flex /tmp/flex \
RUN git clone --depth 500 --filter blob:none --no-checkout https://github.com/GluuFederation/flex /tmp/flex \
&& cd /tmp/flex \
&& git sparse-checkout init --cone \
&& git checkout ${FLEX_SOURCE_VERSION} \
Expand Down Expand Up @@ -58,31 +58,21 @@ RUN usermod -m -d /home/1000 node
# Ports for nginx
EXPOSE 8080

# ======
# Python
# ======

COPY requirements.txt /app/requirements.txt
RUN mv /usr/lib/python3.11/EXTERNALLY-MANAGED /usr/lib/python3.11/EXTERNALLY-MANAGED.disabled \
&& python3 -m ensurepip \
&& pip3 install --no-cache-dir -U pip wheel setuptools \
&& pip3 install --no-cache-dir -r /app/requirements.txt \
&& pip3 uninstall -y pip wheel

# =====================
# jans-linux-setup sync
# =====================
# ===========
# Assets sync
# ===========

ENV JANS_SOURCE_VERSION=af7e99f6dc280f5e4afbe8be2d006a52316de9d1
ENV JANS_SOURCE_VERSION=c89fb50f1ccfdba8ac8f6e050ff3648e3106bdb3
ARG JANS_SETUP_DIR=jans-linux-setup/jans_setup

# note that as we're pulling from a monorepo (with multiple project in it)
# we are using partial-clone and sparse-checkout to get the jans-linux-setup code
RUN git clone --filter blob:none --no-checkout https://github.com/janssenproject/jans /tmp/jans \
# we are using partial-clone and sparse-checkout to get the assets
RUN git clone --depth 500 --filter blob:none --no-checkout https://github.com/janssenproject/jans /tmp/jans \
&& cd /tmp/jans \
&& git sparse-checkout init --cone \
&& git checkout ${JANS_SOURCE_VERSION} \
&& git sparse-checkout set ${JANS_SETUP_DIR}
&& git sparse-checkout add ${JANS_SETUP_DIR} \
&& git sparse-checkout add jans-pycloudlib

RUN mkdir -p /app/static/rdbm /app/schema

Expand All @@ -103,6 +93,17 @@ RUN cd /tmp/jans \
COPY --from=builder /opt/flex/admin-ui /opt/flex/admin-ui
COPY --from=builder /app/templates/admin-ui /app/templates/admin-ui

# ======
# Python
# ======

COPY requirements.txt /app/requirements.txt
RUN mv /usr/lib/python3.11/EXTERNALLY-MANAGED /usr/lib/python3.11/EXTERNALLY-MANAGED.disabled \
&& python3 -m ensurepip \
&& pip3 install --no-cache-dir -U pip wheel setuptools \
&& pip3 install --no-cache-dir -r /app/requirements.txt \
&& pip3 uninstall -y pip wheel

# =======
# Cleanup
# =======
Expand Down
2 changes: 1 addition & 1 deletion docker-admin-ui/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pinned to py3-grpcio version to avoid failure on native extension build
sh==2.0.6
grpcio==1.59.3
git+https://github.com/JanssenProject/jans@19f0deb368617c344df24abeff0b913bbbfdd6b9#egg=jans-pycloudlib&subdirectory=jans-pycloudlib
/tmp/jans/jans-pycloudlib
16 changes: 15 additions & 1 deletion docker-flex-all-in-one/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ COPY --from=flex-admin-ui-src /run/nginx/nginx.pid /run/nginx/nginx.pid
COPY --from=flex-admin-ui-src /app/scripts /app/flex_aio/admin_ui
RUN ln -sf /app/flex_aio/admin_ui/entrypoint.sh /app/bin/admin-ui-entrypoint.sh

# ===========
# Assets sync
# ===========

ENV JANS_SOURCE_VERSION=c89fb50f1ccfdba8ac8f6e050ff3648e3106bdb3

# note that as we're pulling from a monorepo (with multiple project in it)
# we are using partial-clone and sparse-checkout to get the assets
RUN git clone --depth 500 --filter blob:none --no-checkout https://github.com/janssenproject/jans /tmp/jans \
&& cd /tmp/jans \
&& git sparse-checkout init --cone \
&& git checkout ${JANS_SOURCE_VERSION} \
&& git sparse-checkout add jans-pycloudlib

# ------
# Python
# ------
Expand All @@ -77,7 +91,7 @@ RUN mv /usr/lib/python3.11/EXTERNALLY-MANAGED /usr/lib/python3.11/EXTERNALLY-MAN
# -------

RUN apk del .build-deps \
&& rm -rf /var/cache/apk/*
&& rm -rf /var/cache/apk/* /tmp/jans

# ----
# misc
Expand Down