Skip to content

Commit

Permalink
Merge branch 'release' into 'master'
Browse files Browse the repository at this point in the history
Release ADCM 2.0

See merge request arenadata/development/adcm!3518
  • Loading branch information
kuhella committed Dec 24, 2023
2 parents 270d139 + ff663b0 commit f8c064d
Show file tree
Hide file tree
Showing 1,532 changed files with 104,594 additions and 6,213 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
data
venv
web
adcm-web
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include:
- project: "arenadata/infrastructure/code/ci/gitlab_ci_files"
ref: master
file: "/development/adcm.yml"
file: "/development/adcm_v2.yml"
16 changes: 8 additions & 8 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
tests/ @aer @v.chudasov
/data/ @aas @d.skrynnik @aer
/conf/ @aas @d.skrynnik @a.starovoitov @aer
/go/ @aas @d.skrynnik @aer
/os/ @aas @d.skrynnik @aer
/python/ @aas @d.skrynnik @a.starovoitov @aer
/spec/ @aas @d.skrynnik @aer
/web/ @v.remizov @d.bardin @k.fedorenko
.dockerignore @aas @v.remizov @d.skrynnik @aer @v.chudasov
.gitignore @aas @d.skrynnik @v.remizov @d.bardin @k.fedorenko @aer @v.chudasov
.gitlab-ci.yaml @aas @v.remizov @d.skrynnik @aer @v.chudasov
.pre-commit-config.yaml @aas @d.skrynnik @v.remizov @d.bardin @k.fedorenko @aer @v.chudasov
CODEOWNERS @aas @v.remizov @d.skrynnik @aer @v.chudasov
.dockerignore @aas @v.remizov @d.skrynnik @aer
.gitignore @aas @d.skrynnik @v.remizov @d.bardin @k.fedorenko @aer
.gitlab-ci.yaml @aas @v.remizov @d.skrynnik @aer
.pre-commit-config.yaml @aas @d.skrynnik @v.remizov @d.bardin @k.fedorenko @aer
CODEOWNERS @aas @v.remizov @d.skrynnik @aer
COPYRIGHT @aas @v.remizov @d.skrynnik @aer
Dockerfile @aas @v.remizov @d.skrynnik @aer
LICENSE @aas @v.remizov @d.skrynnik @aer
license_checker.py @aas @d.skrynnik @aer
Makefile @aas @d.skrynnik @aer
pyproject.toml @aas @d.skrynnik @aer @v.chudasov
README.md @aas @d.skrynnik @v.remizov @d.bardin @k.fedorenko @a.starovoitov @aer @v.chudasov
poetry.lock @aas @d.skrynnik @aer @a.starovoitov
pyproject.toml @aas @d.skrynnik @aer @a.starovoitov
README.md @aas @d.skrynnik @v.remizov @d.bardin @k.fedorenko @a.starovoitov @aer
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,7 @@ RUN mkdir -p /adcm/data/log && \
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/
ARG ADCM_VERSION
ENV ADCM_VERSION=$ADCM_VERSION
EXPOSE 8000
CMD ["/etc/startup.sh"]
28 changes: 21 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,43 @@ APP_IMAGE ?= hub.adsw.io/adcm/adcm
APP_TAG ?= $(subst /,_,$(BRANCH_NAME))
SELENOID_HOST ?= 10.92.2.65
SELENOID_PORT ?= 4444
ADCM_VERSION = "2.0.0"

.PHONY: help

help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

describe:
describe_old:
@echo '{"version": "$(shell date '+%Y.%m.%d.%H')","commit_id": "$(shell git log --pretty=format:'%h' -n 1)"}' > config.json
cp config.json web/src/assets/config.json

buildss:
@docker run -i --rm -v $(CURDIR)/go:/code -w /code golang sh -c "make"

buildjs:
buildjs_old:
@docker run -i --rm -v $(CURDIR)/wwwroot:/wwwroot -v $(CURDIR)/web:/code -w /code node:16-alpine ./build.sh

buildjs:
@docker run -i --rm -v $(CURDIR)/wwwroot:/wwwroot -v $(CURDIR)/adcm-web/app:/code -e ADCM_VERSION=$(ADCM_VERSION) -w /code node:18.16-alpine ./build.sh

build_base_old:
@docker build . -t $(APP_IMAGE):$(APP_TAG)_old

build_base:
@docker build . -t $(APP_IMAGE):$(APP_TAG)
@docker build . -t $(APP_IMAGE):$(APP_TAG) --build-arg ADCM_VERSION=$(ADCM_VERSION)

# build ADCM_v1
build_old: describe_old buildss buildjs_old build_base_old

build: describe buildss buildjs build_base
# build ADCM_v2
build: buildss buildjs build_base

unittests_sqlite: describe
unittests_sqlite:
poetry install --no-root --with unittests
poetry run python/manage.py test python -v 2 --parallel

unittests_postgresql: describe
unittests_postgresql:
docker run -d --rm -e POSTGRES_PASSWORD="postgres" --name postgres -p 5500:5432 postgres:14
export DB_HOST="localhost" DB_PORT="5500" DB_NAME="postgres" DB_PASS="postgres" DB_USER="postgres"
poetry install --no-root --with unittests
Expand All @@ -52,4 +63,7 @@ lint:
poetry run autoflake --check --quiet -r --remove-all-unused-imports --exclude apps.py,python/ansible/plugins,python/init_db.py,python/task_runner.py,python/backupdb.py,python/job_runner.py,python/drf_docs.py license_checker.py python
poetry run isort --check license_checker.py python
python license_checker.py --folders python go
poetry run pylint --rcfile pyproject.toml --recursive y python
poetry run pylint -j 0 --rcfile pyproject.toml --recursive y python

version:
@echo $(ADCM_VERSION)
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ buildss Build status server
clean Cleanup. Just a cleanup.
describe Create .version file with output of describe
help Shows that help
build2js For new design and api v2: Build client side js/html/css in directory wwwroot
build2 For new design and api v2: Build final docker image and all depended targets except baseimage.
```
And check out the description for every operation available.
Expand Down
17 changes: 17 additions & 0 deletions adcm-web/app/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.svg]
insert_final_newline = false


[*.md]
max_line_length = off
trim_trailing_whitespace = false
3 changes: 3 additions & 0 deletions adcm-web/app/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ADCM_API_HOST=http://localhost:8000
ADCM_WS_HOST=ws://localhost:8000
ADCM_VERSION=2.0.0
3 changes: 3 additions & 0 deletions adcm-web/app/.env.testing
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ADCM_API_HOST=http://localhost:8000
ADCM_WS_HOST=ws://localhost:8000
ADCM_VERSION=2.0.0
145 changes: 145 additions & 0 deletions adcm-web/app/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["react", "prettier", "@typescript-eslint", "react-hooks", "react-refresh", "spellcheck"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
"plugin:storybook/recommended",
"plugin:prettier/recommended",
"prettier"
],
"rules": {
"@typescript-eslint/no-unused-vars": ["error", { "ignoreRestSiblings": true }],
"react-refresh/only-export-components": "warn",
"object-curly-spacing": [2, "always"],
"quotes": ["error", "single"],
"semi": ["warn", "always"],
"comma-dangle": ["error", "always-multiline"],
"space-before-function-paren": ["error", { "anonymous": "always", "named": "never", "asyncArrow": "always" }],
"react/jsx-max-props-per-line": [1, { "when": "multiline" }],
"spellcheck/spell-checker": [
"warn",
{
"skipWords": [
"100vw",
"acc",
"accesslog",
"accessor",
"adcm",
"administrator’s",
"ansible",
"api",
"arenadata",
"authed",
"axios",
"attribs",
"calc",
"cancelable",
"cancelled",
"cancelling",
"checkbox",
"checkboxes",
"charset",
"cn",
"comparator",
"csrftoken",
"ctx",
"dataset",
"datetime",
"debounce",
"debounced",
"deletable",
"dialogs",
"django",
"dropdown",
"dom",
"enum",
"guid",
"gz",
"hljs",
"hostcomponentmap",
"hostprovider",
"hostproviders",
"href",
"io",
"javascript",
"linkable",
"ldap",
"maintenance",
"mouseenter",
"mouseleave",
"mousemove",
"mouseup",
"mql",
"multiline",
"nanoid",
"noopener",
"noreferrer",
"nullable",
"num",
"parametrized",
"path",
"pathname",
"perf",
"pid",
"qs",
"quaternary",
"queueing",
"rbac",
"readonly",
"rect",
"redux",
"resize",
"rp",
"req",
"schemas",
"searchable",
"sql",
"ssl",
"statusable",
"stderr",
"stdout",
"str",
"svg",
"svgr",
"td",
"Terminatable",
"textarea",
"th",
"tgz",
"toggler",
"tooltip",
"ttl",
"ul",
"unlink",
"unlinked",
"unlinkable",
"unlinking",
"unmap",
"unmapped",
"unmount",
"uncheck",
"upgradable",
"uri",
"yaml",
"user’s",
"vite",
"ws",
"wss",
"xsrf"
]
}
],
"no-console": [
"error",
{
"allow": ["info", "warn", "error"]
}
]
}
}
36 changes: 36 additions & 0 deletions adcm-web/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

.yarn/*
.pnp.*

!.env.development
!.env.testing
!.eslintrc.json
!.eslintrc.cjs
!.prettierrc.json
!.storybook
!.husky
!.editorconfig
1 change: 1 addition & 0 deletions adcm-web/app/.husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
7 changes: 7 additions & 0 deletions adcm-web/app/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

cd adcm-web/app
yarn lint
yarn tsc
echo "lint"
8 changes: 8 additions & 0 deletions adcm-web/app/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 120,
"tabWidth": 2,
"endOfLine": "lf"
}
10 changes: 10 additions & 0 deletions adcm-web/app/.storybook/ThemeDecorator.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { useEffect } from 'react';

export const withThemeProvider = (Story, context) => {
useEffect(() => {
const isDark = context.globals.theme === 'dark';
document.body.classList.toggle('theme-dark', isDark);
document.body.classList.toggle('theme-light', !isDark);
}, [context.globals.theme])
return (<Story />);
};
19 changes: 19 additions & 0 deletions adcm-web/app/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// import path from 'path';

import type { StorybookConfig } from '@storybook/react-vite';
const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
],
framework: {
name: '@storybook/react-vite',
options: {},
},
docs: {
autodocs: 'tag',
},
};
export default config;
3 changes: 3 additions & 0 deletions adcm-web/app/.storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500&family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
Loading

0 comments on commit f8c064d

Please sign in to comment.