Browse Source

perf: 优化构建 (#9179)

* perf: 优化构建

* fix: 修正构建错误

* perf: 优化构建依赖包

* fix: 修正构建判断

* perf: 现阶段还需要 debug 工具

Co-authored-by: 吴小白 <296015668@qq.com>
pull/9182/head
fit2bot 2 years ago committed by GitHub
parent
commit
0ae9b76f04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      Dockerfile
  2. 10
      Dockerfile-ee
  3. 18
      Dockerfile.loong64
  4. 24
      requirements/requirements.txt
  5. 24
      requirements/requirements_xpack.txt

16
Dockerfile

@ -18,7 +18,6 @@ ARG BUILD_DEPENDENCIES=" \
pkg-config"
ARG DEPENDENCIES=" \
default-libmysqlclient-dev \
freetds-dev \
libpq-dev \
libffi-dev \
@ -28,20 +27,15 @@ ARG DEPENDENCIES=" \
libxml2-dev \
libxmlsec1-dev \
libxmlsec1-openssl \
libaio-dev \
openssh-client \
sshpass"
libaio-dev"
ARG TOOLS=" \
ca-certificates \
curl \
default-mysql-client \
iputils-ping \
default-libmysqlclient-dev \
locales \
procps \
redis-tools \
openssh-client \
sshpass \
telnet \
vim \
unzip \
wget"
@ -82,6 +76,8 @@ ENV PIP_MIRROR=$PIP_MIRROR
ARG PIP_JMS_MIRROR=https://pypi.douban.com/simple
ENV PIP_JMS_MIRROR=$PIP_JMS_MIRROR
ARG DEBUG
RUN --mount=type=cache,target=/root/.cache/pip \
set -ex \
&& pip config set global.index-url ${PIP_MIRROR} \

10
Dockerfile-ee

@ -0,0 +1,10 @@
ARG VERSION
FROM registry.fit2cloud.com/jumpserver/xpack:${VERSION} as build-xpack
FROM jumpserver/core:${VERSION}
COPY --from=build-xpack /opt/xpack /opt/jumpserver/apps/xpack
WORKDIR /opt/jumpserver
RUN --mount=type=cache,target=/root/.cache/pip \
set -ex \
&& pip install -r requirements/requirements_xpack.txt

18
Dockerfile.loong64

@ -18,7 +18,6 @@ ARG BUILD_DEPENDENCIES=" \
pkg-config"
ARG DEPENDENCIES=" \
default-libmysqlclient-dev \
freetds-dev \
libpq-dev \
libffi-dev \
@ -28,20 +27,15 @@ ARG DEPENDENCIES=" \
libxml2-dev \
libxmlsec1-dev \
libxmlsec1-openssl \
libaio-dev \
openssh-client \
sshpass"
libaio-dev"
ARG TOOLS=" \
ca-certificates \
curl \
default-mysql-client \
iputils-ping \
default-libmysqlclient-dev \
locales \
netcat \
redis-server \
openssh-client \
sshpass \
telnet \
vim \
unzip \
wget"
@ -69,12 +63,14 @@ ENV PIP_MIRROR=$PIP_MIRROR
ARG PIP_JMS_MIRROR=https://pypi.douban.com/simple
ENV PIP_JMS_MIRROR=$PIP_JMS_MIRROR
ARG DEBUG
RUN --mount=type=cache,target=/root/.cache/pip \
set -ex \
&& pip config set global.index-url ${PIP_MIRROR} \
&& pip install --upgrade pip \
&& pip install --upgrade setuptools wheel \
&& pip install https://download.jumpserver.org/pypi/simple/cryptography/cryptography-36.0.1-cp38-cp38-linux_loongarch64.whl \
&& pip install https://download.jumpserver.org/pypi/simple/cryptography/cryptography-36.0.2-cp38-cp38-linux_loongarch64.whl \
&& pip install https://download.jumpserver.org/pypi/simple/greenlet/greenlet-1.1.2-cp38-cp38-linux_loongarch64.whl \
&& pip install $(grep 'PyNaCl' requirements/requirements.txt) \
&& GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=true pip install grpcio \

24
requirements/requirements.txt

@ -25,7 +25,7 @@ paramiko==2.11.0
passlib==1.7.4
pyasn1==0.4.8
pycparser==2.21
cryptography==37.0.4
cryptography==36.0.2
pycryptodome==3.15.0
pycryptodomex==3.15.0
gmssl==3.2.1
@ -87,7 +87,6 @@ pytz==2022.1
# Runtime
django-proxy==1.2.1
channels-redis==3.4.0
channels==3.0.4
python-daemon==2.3.0
eventlet==0.33.1
greenlet==1.1.2
@ -107,23 +106,6 @@ django-cas-ng==4.0.1
python-cas==1.5.0
django-auth-ldap==2.2.0
# Cloud req
qingcloud-sdk==1.2.12
azure-mgmt-subscription==1.0.0
azure-identity==1.5.0
azure-mgmt-compute==4.6.2
azure-mgmt-network==2.7.0
google-cloud-compute==0.5.0
alibabacloud_dysmsapi20170525==2.0.2
python-novaclient==11.0.1
python-keystoneclient==4.3.0
bce-python-sdk==0.8.64
tencentcloud-sdk-python==3.0.662
aliyun-python-sdk-core-v3==2.9.1
aliyun-python-sdk-ecs==4.10.1
huaweicloud-sdk-python==1.0.21
# python-keystoneclient need keystoneauth1>=3.4.0
# huaweicloud-sdk-python need keystoneauth1<=3.4.0
keystoneauth1==3.4.0
boto3==1.24.12
botocore==1.27.12
s3transfer==0.6.0
@ -131,8 +113,6 @@ kubernetes==21.7.0
# DB requirements
mysqlclient==2.1.0
PyMySQL==1.0.2
oracledb==1.0.1
psycopg2-binary==2.9.1
pymssql==2.2.5
django-mysql==3.9.0
django-redis==5.2.0
@ -146,5 +126,3 @@ ipython==8.4.0
ForgeryPy3==0.3.1
django-debug-toolbar==3.5
Pympler==1.0.1
IPy==1.1
psycopg2==2.9.4

24
requirements/requirements_xpack.txt

@ -0,0 +1,24 @@
# Cloud req
qingcloud-sdk==1.2.12
azure-mgmt-subscription==1.0.0
azure-identity==1.5.0
azure-mgmt-compute==4.6.2
azure-mgmt-network==2.7.0
google-cloud-compute==0.5.0
alibabacloud_dysmsapi20170525==2.0.2
python-novaclient==11.0.1
python-keystoneclient==4.3.0
bce-python-sdk==0.8.64
tencentcloud-sdk-python==3.0.662
aliyun-python-sdk-core-v3==2.9.1
aliyun-python-sdk-ecs==4.10.1
huaweicloud-sdk-python==1.0.21
# python-keystoneclient need keystoneauth1>=3.4.0
# huaweicloud-sdk-python need keystoneauth1<=3.4.0
keystoneauth1==3.4.0
# DB requirements
oracledb==1.0.1
psycopg2-binary==2.9.1
pymssql==2.2.5
IPy==1.1
psycopg2==2.9.4
Loading…
Cancel
Save