Skip to content

Commit

Permalink
perf: use python embed (#239)
Browse files Browse the repository at this point in the history
* perf: use python embed

* perf: Update web static version

* perf: Update web static version

---------

Co-authored-by: 吴小白 <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 18, 2024
1 parent f669d41 commit 2501842
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 42 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM jumpserver/luna:${VERSION} AS luna
FROM nginx:1.24-bullseye
ARG TARGETARCH

ARG CHECK_VERSION=v1.0.3
ARG CHECK_VERSION=v1.0.4
ARG APT_MIRROR=http://deb.debian.org

ARG TOOLS=" \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile-ee
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG VERSION=dev
FROM jumpserver/web-static:20241012_082502 AS static
FROM jumpserver/web-static:20241018_025026 AS static
FROM jumpserver/web:${VERSION}-ce

COPY --from=static /opt/ /opt/
39 changes: 1 addition & 38 deletions Dockerfile-static
Original file line number Diff line number Diff line change
@@ -1,45 +1,8 @@
FROM python:3.11-alpine3.20 AS stage-build
ARG TARGETARCH

ARG DEPENDENCIES=" \
ca-certificates \
curl \
zip"

RUN apk add --no-cache ${DEPENDENCIES}

WORKDIR /opt/applets

COPY ../requirements.txt ./requirements.txt

ARG PIP_MIRROR=https://pypi.org/simple
RUN set -ex \
&& mkdir pip_packages build \
&& pip config set global.index-url ${PIP_MIRROR} \
&& pip download \
--only-binary=:all: --platform win_amd64 \
--python-version 3.11.6 --abi cp311 \
-d pip_packages -r requirements.txt -i${PIP_MIRROR} \
&& cp requirements.txt pip_packages \
&& zip -r pip_packages.zip pip_packages \
&& mv pip_packages.zip build

ARG CHECK_VERSION=v1.0.2
RUN set -ex \
&& wget https://github.com/jumpserver-dev/healthcheck/releases/download/${CHECK_VERSION}/check-${CHECK_VERSION}-linux-${TARGETARCH}.tar.gz \
&& tar -xf check-${CHECK_VERSION}-linux-${TARGETARCH}.tar.gz \
&& mv check /usr/local/bin/ \
&& chown root:root /usr/local/bin/check \
&& chmod 755 /usr/local/bin/check \
&& rm -f check-${CHECK_VERSION}-linux-${TARGETARCH}.tar.gz

FROM alpine:3.20
ARG TARGETARCH

WORKDIR /tmp
COPY . .
RUN set -ex \
&& apk add --no-cache bash \
&& bash ./prepare.sh

COPY --from=stage-build /opt/applets/build /opt/download/applets
COPY --from=stage-build /usr/local/bin/check /usr/local/bin/check
2 changes: 1 addition & 1 deletion prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ mkdir -p ${DOWNLOAD_DIR}/applets
cd ${DOWNLOAD_DIR}/applets || exit 1
wget -O chromedriver-${CHROME_DRIVER_VERSION}-win64.zip https://github.com/jumpserver-dev/Chrome-Portable-Win64/releases/download/${CHROME_DRIVER_VERSION}/chromedriver-win64.zip
wget -O chrome-${CHROME_VERSION}-win.zip https://github.com/jumpserver-dev/Chrome-Portable-Win64/releases/download/${CHROME_VERSION}/chrome-win.zip
wget https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-amd64.exe
wget https://github.com/jumpserver-dev/Python-Embed-Win64/releases/download/${PYTHON_VERSION}/jumpserver-tinker-python-${PYTHON_VERSION}-win64.zip
wget ${DOWNLOAD_URL}/public/dbeaver-ce-${DBEAVER_VERSION}-x86_64-setup.exe
wget ${DOWNLOAD_URL}/public/dbeaver-patch-${DBEAVER_VERSION}-x86_64-setup.msi
wget ${DOWNLOAD_URL}/public/Tinker_Installer_${TINKER_VERSION}.exe
Expand Down
2 changes: 1 addition & 1 deletion versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 1. https://github.com/jumpserver/jumpserver/blob/dev/apps/jumpserver/views/other.py#L99
# 2. https://github.com/jumpserver/jumpserver/blob/dev/apps/terminal/automations/deploy_applet_host/playbook.yml#L18
PLAY_VERSION=1.1.0-1
PYTHON_VERSION=3.11.6
PYTHON_VERSION=3.11.10
CHROME_VERSION=118.0.5993.118
CHROME_DRIVER_VERSION=118.0.5993.70
DBEAVER_VERSION=22.3.4
Expand Down

0 comments on commit 2501842

Please sign in to comment.