-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release' into 'master'
RELEASE 2.4.0 See merge request arenadata/development/adcm!4120
- Loading branch information
Showing
305 changed files
with
13,862 additions
and
7,447 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
**/*.git* | ||
**/.* | ||
.* | ||
go/**/.* | ||
python/**/.* | ||
**/tests/ | ||
data | ||
venv | ||
adcm-web | ||
dev | ||
venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,29 @@ | ||
FROM golang:1.23 AS go_builder | ||
COPY ./go /code | ||
WORKDIR /code | ||
RUN sh -c "make" | ||
|
||
|
||
FROM node:20.9.0-alpine AS ui_builder | ||
ARG ADCM_VERSION | ||
ENV ADCM_VERSION=$ADCM_VERSION | ||
COPY ./adcm-web/app /code | ||
WORKDIR /code | ||
RUN . build.sh | ||
|
||
|
||
FROM python:3.10-alpine | ||
ENV PATH="/root/.local/bin:$PATH" | ||
RUN apk update && \ | ||
apk upgrade && \ | ||
apk add --virtual .build-deps \ | ||
build-base \ | ||
linux-headers && \ | ||
apk add \ | ||
apk add --no-cache \ | ||
bash \ | ||
curl \ | ||
git \ | ||
gnupg \ | ||
libc6-compat \ | ||
libffi \ | ||
libstdc++ \ | ||
libxslt \ | ||
logrotate \ | ||
musl-dev \ | ||
nginx \ | ||
openldap-dev \ | ||
|
@@ -23,27 +33,54 @@ RUN apk update && \ | |
rsync \ | ||
runit \ | ||
sshpass && \ | ||
curl -sSL https://install.python-poetry.org | python - | ||
ENV PATH="/root/.local/bin:$PATH" | ||
COPY pyproject.toml /adcm/ | ||
COPY poetry.lock /adcm/ | ||
RUN python -m venv /adcm/venv/2.9 && \ | ||
poetry config virtualenvs.create false && \ | ||
poetry -C /adcm install --no-root && \ | ||
cp -r /usr/local/lib/python3.10/site-packages /adcm/venv/2.9/lib/python3.10 && \ | ||
. /adcm/venv/2.9/bin/activate && \ | ||
pip install git+https://github.com/arenadata/[email protected] && \ | ||
deactivate | ||
RUN apk del .build-deps | ||
COPY . /adcm | ||
RUN mkdir -p /adcm/data/log && \ | ||
mkdir -p /usr/share/ansible/plugins/modules && \ | ||
cp -r /adcm/os/* / && \ | ||
cp /adcm/os/etc/crontabs/root /var/spool/cron/crontabs/root && \ | ||
cp -r /adcm/python/ansible/* /usr/local/lib/python3.10/site-packages/ansible/ && \ | ||
cp -r /adcm/python/ansible/* /adcm/venv/2.9/lib/python3.10/site-packages/ansible/ && \ | ||
python /adcm/python/manage.py collectstatic --noinput && \ | ||
cp -r /adcm/wwwroot/static/rest_framework/css/* /adcm/wwwroot/static/rest_framework/docs/css/ | ||
apk cache clean --purge | ||
|
||
ENV PYTHONDONTWRITECODE=1 | ||
ENV PYTHONBUFFERED=1 | ||
|
||
ENV POETRY_VERSION=1.8.3 | ||
ENV POETRY_HOME=/opt/poetry | ||
ENV POETRY_VENV=/opt/poetry-venv | ||
ENV POETRY_CACHE_DIR=/opt/poetry-cache | ||
ENV POETRY_VIRTUALENVS_CREATE=0 | ||
|
||
COPY poetry.lock pyproject.toml /adcm/ | ||
|
||
RUN apk add --no-cache --virtual .build-deps \ | ||
build-base \ | ||
linux-headers \ | ||
libffi-dev && \ | ||
# remove python links (3.12) from /usr/bin and link python to local one (3.10) | ||
rm /usr/bin/python /usr/bin/python3 && \ | ||
ln -s /usr/local/bin/python3 /usr/bin/python3 && \ | ||
ln -s /usr/bin/python3 /usr/bin/python && \ | ||
python -m venv $POETRY_VENV && \ | ||
$POETRY_VENV/bin/pip install --no-cache-dir -U pip setuptools && \ | ||
$POETRY_VENV/bin/pip install --no-cache-dir poetry==$POETRY_VERSION && \ | ||
$POETRY_VENV/bin/poetry --no-cache --directory=/adcm install --no-root && \ | ||
python -m venv /adcm/venv/2.9 --system-site-packages && \ | ||
/adcm/venv/2.9/bin/pip install --no-cache-dir git+https://github.com/arenadata/[email protected] && \ | ||
$POETRY_VENV/bin/poetry cache clear pypi --all && \ | ||
apk del .build-deps && \ | ||
apk cache clean --purge && \ | ||
rm -rf $POETRY_HOME && \ | ||
rm -rf $POETRY_VENV && \ | ||
rm -rf $POETRY_CACHE_DIR | ||
|
||
RUN rm /adcm/poetry.lock /adcm/pyproject.toml | ||
|
||
COPY os/etc /etc | ||
COPY os/etc/crontabs/root /var/spool/cron/crontabs/root | ||
COPY --from=go_builder /code/bin/runstatus /adcm/go/bin/runstatus | ||
COPY --from=ui_builder /wwwroot /adcm/wwwroot | ||
COPY conf /adcm/conf | ||
COPY python/ansible/plugins /usr/share/ansible/plugins | ||
COPY python /adcm/python | ||
|
||
RUN mkdir -p /adcm/data/log | ||
|
||
RUN python /adcm/python/manage.py collectstatic --noinput | ||
|
||
ARG ADCM_VERSION | ||
ENV ADCM_VERSION=$ADCM_VERSION | ||
EXPOSE 8000 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { ESLint } from 'eslint' | ||
|
||
const eslintCheck = (filenames) => `eslint ${filenames.join(' ')} --ext ts,tsx --report-unused-disable-directives --max-warnings 0`; | ||
|
||
/** | ||
* lint-stage don't understand .eslintignore file | ||
* https://www.curiouslychase.com/posts/eslint-error-file-ignored-because-of-a-matching-ignore-pattern/ | ||
*/ | ||
const removeIgnoredFiles = async (files) => { | ||
const eslint = new ESLint() | ||
const isIgnored = await Promise.all( | ||
files.map((file) => { | ||
return eslint.isPathIgnored(file) | ||
}) | ||
) | ||
return files.filter((_, i) => !isIgnored[i]); | ||
} | ||
|
||
export default { | ||
'*.(js|jsx|ts|tsx)': async (filenames) => { | ||
// Run ESLint on entire repo if more than 10 staged files | ||
if (filenames.length > 10) { | ||
return 'yarn lint' | ||
} | ||
const filesToLint = await removeIgnoredFiles(filenames); | ||
return eslintCheck(filesToLint); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
#!/bin/sh | ||
|
||
yarn set version berry | ||
# Set Yarn version | ||
YARN_VERSION=4.5.0 | ||
|
||
corepack enable && corepack prepare yarn@$YARN_VERSION | ||
#yarn set version $YARN_VERSION | ||
yarn install | ||
yarn build --mode production --outDir /wwwroot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.