From b77090f3f9e5519d955964d26dccff2d06d26fbd Mon Sep 17 00:00:00 2001 From: Kirill Chernakov Date: Sun, 8 Dec 2024 15:05:45 +0400 Subject: [PATCH 01/24] chore: use node v20 (cherry picked from commit 642393ff0f4929a746811e73abfb683e278d4c74) --- docker/Dockerfile.ui | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docker/Dockerfile.ui b/docker/Dockerfile.ui index 6b0d4210a..b0f3aa1a4 100644 --- a/docker/Dockerfile.ui +++ b/docker/Dockerfile.ui @@ -1,6 +1,4 @@ - - -FROM node:18-alpine AS base +FROM node:20-alpine AS base # Install dependencies only when needed FROM base AS deps From 828ccc52b7c1f073b461ba45cf366096b85c7b24 Mon Sep 17 00:00:00 2001 From: Kirill Chernakov Date: Sun, 8 Dec 2024 15:04:48 +0400 Subject: [PATCH 02/24] fix: add .gitignore to keep-ui for docker to respect it with context: ./keep-ui (cherry picked from commit 5642f9983605e4802da488991326cb907926c3d8) --- keep-ui/.dockerignore | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 keep-ui/.dockerignore diff --git a/keep-ui/.dockerignore b/keep-ui/.dockerignore new file mode 100644 index 000000000..d38b75ee9 --- /dev/null +++ b/keep-ui/.dockerignore @@ -0,0 +1,8 @@ +node_modules +.next +.vercel +.env.* +.venv/ +.vscode/ +.github/ +.pytest_cache From 7ef49dcffa73f2c0f8f0f740ca5a5d93b1be499b Mon Sep 17 00:00:00 2001 From: Kirill Chernakov Date: Mon, 9 Dec 2024 22:14:12 +0400 Subject: [PATCH 03/24] try docker/bake-action --- .github/workflows/test-pr-e2e.yml | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-pr-e2e.yml b/.github/workflows/test-pr-e2e.yml index ba7cb43e5..480b4bc94 100644 --- a/.github/workflows/test-pr-e2e.yml +++ b/.github/workflows/test-pr-e2e.yml @@ -66,9 +66,38 @@ jobs: - name: Install playwright run: poetry run playwright install + - name: Set up Docker cache + id: docker-cache + uses: actions/cache@v4 + with: + path: /tmp/.docker-cache + key: docker-${{ runner.os }}-${{ matrix.db_type }}-${{ hashFiles('**/Dockerfile*', '**/poetry.lock', '**/package-lock.json') }} + restore-keys: | + docker-${{ runner.os }}-${{ matrix.db_type }}- + - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 + with: + driver: docker-container + + - name: Build Docker images + uses: docker/bake-action@v5 + with: + workdir: . + files: | + tests/e2e_tests/docker-compose-e2e-${{ matrix.db_type }}.yml + load: true + set: | + *.cache-from=type=local,src=/tmp/.docker-cache + ${{ steps.docker-cache.outputs.cache-hit != 'true' && '*.cache-to=type=local,dest=/tmp/.docker-cache-new' || '' }} + + - name: Move Docker caches + if: always() + run: | + rm -rf /tmp/.docker-cache || true + mv /tmp/.docker-cache-new /tmp/.docker-cache || true + # Now start the environment (images are already built and cached) - name: Set up Keep environment run: | DOCKER_BUILDKIT=1 docker compose \ From 5e728c0db342680d35bef80b9b903bb2b074f289 Mon Sep 17 00:00:00 2001 From: Kirill Chernakov Date: Mon, 9 Dec 2024 22:39:57 +0400 Subject: [PATCH 04/24] touch frontend --- keep-ui/app/(keep)/page.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/keep-ui/app/(keep)/page.tsx b/keep-ui/app/(keep)/page.tsx index 8c4ad84ad..f56dbe805 100644 --- a/keep-ui/app/(keep)/page.tsx +++ b/keep-ui/app/(keep)/page.tsx @@ -4,5 +4,4 @@ export const metadata = { title: "Keep", description: "The open-source AIOps and alert management platform.", }; - export default ProvidersPage; From 372af19e46d70676ae02bf2572c5b93ce59dcb72 Mon Sep 17 00:00:00 2001 From: Kirill Chernakov Date: Tue, 10 Dec 2024 14:42:06 +0400 Subject: [PATCH 05/24] try gha cache --- .github/workflows/test-pr-e2e.yml | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test-pr-e2e.yml b/.github/workflows/test-pr-e2e.yml index 480b4bc94..8df22e10f 100644 --- a/.github/workflows/test-pr-e2e.yml +++ b/.github/workflows/test-pr-e2e.yml @@ -66,15 +66,6 @@ jobs: - name: Install playwright run: poetry run playwright install - - name: Set up Docker cache - id: docker-cache - uses: actions/cache@v4 - with: - path: /tmp/.docker-cache - key: docker-${{ runner.os }}-${{ matrix.db_type }}-${{ hashFiles('**/Dockerfile*', '**/poetry.lock', '**/package-lock.json') }} - restore-keys: | - docker-${{ runner.os }}-${{ matrix.db_type }}- - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 with: @@ -88,16 +79,9 @@ jobs: tests/e2e_tests/docker-compose-e2e-${{ matrix.db_type }}.yml load: true set: | - *.cache-from=type=local,src=/tmp/.docker-cache - ${{ steps.docker-cache.outputs.cache-hit != 'true' && '*.cache-to=type=local,dest=/tmp/.docker-cache-new' || '' }} - - - name: Move Docker caches - if: always() - run: | - rm -rf /tmp/.docker-cache || true - mv /tmp/.docker-cache-new /tmp/.docker-cache || true + *.cache-from=type=gha + *.cache-to=type=gha,mode=max - # Now start the environment (images are already built and cached) - name: Set up Keep environment run: | DOCKER_BUILDKIT=1 docker compose \ From 23f183661337b05dbc49e4a739340c7b2d42e2ef Mon Sep 17 00:00:00 2001 From: Kirill Chernakov Date: Tue, 10 Dec 2024 14:59:27 +0400 Subject: [PATCH 06/24] expose github runtime variables --- .github/workflows/test-pr-e2e.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-pr-e2e.yml b/.github/workflows/test-pr-e2e.yml index 8df22e10f..5285a3a84 100644 --- a/.github/workflows/test-pr-e2e.yml +++ b/.github/workflows/test-pr-e2e.yml @@ -66,6 +66,9 @@ jobs: - name: Install playwright run: poetry run playwright install + - name: Expose GitHub Runtime + uses: crazy-max/ghaction-github-runtime@v3 + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 with: From c6839ee06a80a68488cccd3afd03ebf2768027f3 Mon Sep 17 00:00:00 2001 From: Kirill Chernakov Date: Tue, 10 Dec 2024 15:28:43 +0400 Subject: [PATCH 07/24] touch backend to trigger e2e --- keep/api/api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/keep/api/api.py b/keep/api/api.py index e0f9cf0fd..9d5ca0d76 100644 --- a/keep/api/api.py +++ b/keep/api/api.py @@ -285,3 +285,4 @@ def run(app: FastAPI): port=PORT, log_config=logging_config, ) + From 0d9381114aafc64d089ce458d721ab3591bf9af4 Mon Sep 17 00:00:00 2001 From: Kirill Chernakov Date: Tue, 10 Dec 2024 16:58:48 +0400 Subject: [PATCH 08/24] try to build in sequence --- tests/e2e_tests/docker-compose-e2e-mysql.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/e2e_tests/docker-compose-e2e-mysql.yml b/tests/e2e_tests/docker-compose-e2e-mysql.yml index 09f73927f..3ae65c703 100644 --- a/tests/e2e_tests/docker-compose-e2e-mysql.yml +++ b/tests/e2e_tests/docker-compose-e2e-mysql.yml @@ -27,6 +27,8 @@ services: - API_URL=http://keep-backend:8080 - POSTHOG_DISABLED=true - SENTRY_DISABLED=true + x-bake: + depends_on: ["keep-backend"] keep-backend: extends: From 7fb074542f3df1b0aeca9d1664e212dfe5506a2c Mon Sep 17 00:00:00 2001 From: Kirill Chernakov Date: Tue, 10 Dec 2024 17:31:36 +0400 Subject: [PATCH 09/24] try separate caches scope --- .github/workflows/test-pr-e2e.yml | 3 --- tests/e2e_tests/docker-compose-e2e-mysql.yml | 12 ++++++++++-- tests/e2e_tests/docker-compose-e2e-postgres.yml | 10 ++++++++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-pr-e2e.yml b/.github/workflows/test-pr-e2e.yml index 5285a3a84..32afc094e 100644 --- a/.github/workflows/test-pr-e2e.yml +++ b/.github/workflows/test-pr-e2e.yml @@ -81,9 +81,6 @@ jobs: files: | tests/e2e_tests/docker-compose-e2e-${{ matrix.db_type }}.yml load: true - set: | - *.cache-from=type=gha - *.cache-to=type=gha,mode=max - name: Set up Keep environment run: | diff --git a/tests/e2e_tests/docker-compose-e2e-mysql.yml b/tests/e2e_tests/docker-compose-e2e-mysql.yml index 3ae65c703..8ece33a9b 100644 --- a/tests/e2e_tests/docker-compose-e2e-mysql.yml +++ b/tests/e2e_tests/docker-compose-e2e-mysql.yml @@ -22,13 +22,16 @@ services: build: context: ./keep-ui/ dockerfile: ../docker/Dockerfile.ui + x-bake: + cache-from: + - type=gha,scope=frontend + cache-to: + - type=gha,mode=max,scope=frontend environment: - AUTH_TYPE=NO_AUTH - API_URL=http://keep-backend:8080 - POSTHOG_DISABLED=true - SENTRY_DISABLED=true - x-bake: - depends_on: ["keep-backend"] keep-backend: extends: @@ -37,6 +40,11 @@ services: build: context: . dockerfile: docker/Dockerfile.api + x-bake: + cache-from: + - type=gha,scope=backend + cache-to: + - type=gha,mode=max,scope=backend environment: - AUTH_TYPE=NO_AUTH - DATABASE_CONNECTION_STRING=mysql+pymysql://root:keep@keep-database:3306/keep diff --git a/tests/e2e_tests/docker-compose-e2e-postgres.yml b/tests/e2e_tests/docker-compose-e2e-postgres.yml index 182ca6be2..fc2b0d0c2 100644 --- a/tests/e2e_tests/docker-compose-e2e-postgres.yml +++ b/tests/e2e_tests/docker-compose-e2e-postgres.yml @@ -20,6 +20,11 @@ services: build: context: ./keep-ui/ dockerfile: ../docker/Dockerfile.ui + x-bake: + cache-from: + - type=gha,scope=frontend + cache-to: + - type=gha,mode=max,scope=frontend environment: - AUTH_TYPE=NO_AUTH - API_URL=http://keep-backend:8080 @@ -33,6 +38,11 @@ services: build: context: . dockerfile: docker/Dockerfile.api + x-bake: + cache-from: + - type=gha,scope=backend + cache-to: + - type=gha,mode=max,scope=backend environment: - AUTH_TYPE=NO_AUTH - DATABASE_CONNECTION_STRING=postgresql://keepuser:keeppassword@keep-database:5432/keepdb From 828bd72b9e42386f08e24362b492f481baa8d6f5 Mon Sep 17 00:00:00 2001 From: Kirill Chernakov Date: Tue, 10 Dec 2024 18:39:31 +0400 Subject: [PATCH 10/24] minimal workflow with build and up --- .../workflows/test-pr-e2e-build-and-run.yml | 104 +++++++++++ .github/workflows/test-pr-e2e.yml | 175 ------------------ 2 files changed, 104 insertions(+), 175 deletions(-) create mode 100644 .github/workflows/test-pr-e2e-build-and-run.yml delete mode 100644 .github/workflows/test-pr-e2e.yml diff --git a/.github/workflows/test-pr-e2e-build-and-run.yml b/.github/workflows/test-pr-e2e-build-and-run.yml new file mode 100644 index 000000000..88c78f58b --- /dev/null +++ b/.github/workflows/test-pr-e2e-build-and-run.yml @@ -0,0 +1,104 @@ +name: Tests (E2E) + +on: + workflow_dispatch: + pull_request: + paths: + - 'keep/**' + - 'keep-ui/**' + - 'tests/**' + +env: + PYTHON_VERSION: 3.11 + STORAGE_MANAGER_DIRECTORY: /tmp/storage-manager + # MySQL server environment variables + MYSQL_ROOT_PASSWORD: keep + MYSQL_DATABASE: keep + # Postgres environment variables + POSTGRES_USER: keepuser + POSTGRES_PASSWORD: keeppassword + POSTGRES_DB: keepdb + # To test if imports are working properly + EE_ENABLED: true + +jobs: + tests-e2e: + runs-on: ubuntu-latest + strategy: + matrix: + db_type: [mysql, postgres] + steps: + - name: Checkout + uses: actions/checkout@v3 + + - uses: chartboost/ruff-action@v1 + with: + src: "./keep" + + - name: Expose GitHub Runtime + uses: crazy-max/ghaction-github-runtime@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver: docker-container + + - name: Build Docker images + uses: docker/bake-action@v5 + with: + workdir: . + files: | + tests/e2e_tests/docker-compose-e2e-mysql.yml + load: true + set: | + *.cache-from=type=gha + *.cache-to=type=gha,mode=max + + - name: Set up Keep environment + run: | + docker compose \ + --project-directory . \ + -f tests/e2e_tests/docker-compose-e2e-mysql.yml up -d + + - name: Wait for services to be ready + run: | + # Add commands to wait for the database to be ready + until docker exec $(docker ps -qf "name=keep-database") mysqladmin ping -h "localhost" --silent; do + echo "Waiting for MySQL to be ready..." + sleep 2 + done + + # wait to keep backend on port 8080 + echo "Waiting for Keep backend to be ready..." + attempt=0 + max_attempts=10 + + until $(curl --output /dev/null --silent --fail http://localhost:8080/healthcheck); do + if [ "$attempt" -ge "$max_attempts" ]; then + echo "Max attempts reached, exiting... Sometimes Keep can't start because of double-headed migrations, use: 'alembic -c keep/alembic.ini history' to investigate, or check artifacts." + exit 1 + fi + echo "Waiting for Keep backend to be ready... (Attempt: $((attempt+1)))" + attempt=$((attempt+1)) + sleep 2 + done + + echo "Keep backend is ready!" + # wait to the backend + echo "Waiting for Keep frontend to be ready..." + attempt=0 + max_attempts=10 + + until $(curl --output /dev/null --silent --fail http://localhost:3000/); do + if [ "$attempt" -ge "$max_attempts" ]; then + echo "Max attempts reached, exiting..." + exit 1 + fi + echo "Waiting for Keep frontend to be ready... (Attempt: $((attempt+1)))" + attempt=$((attempt+1)) + sleep 2 + done + + # create the state directory + # mkdir -p ./state && chown -R root:root ./state && chmod -R 777 ./state + diff --git a/.github/workflows/test-pr-e2e.yml b/.github/workflows/test-pr-e2e.yml deleted file mode 100644 index 32afc094e..000000000 --- a/.github/workflows/test-pr-e2e.yml +++ /dev/null @@ -1,175 +0,0 @@ -name: Tests (E2E) - -on: - workflow_dispatch: - pull_request: - paths: - - 'keep/**' - - 'keep-ui/**' - - 'tests/**' - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true - -env: - PYTHON_VERSION: 3.11 - STORAGE_MANAGER_DIRECTORY: /tmp/storage-manager - # MySQL server environment variables - MYSQL_ROOT_PASSWORD: keep - MYSQL_DATABASE: keep - # Postgres environment variables - POSTGRES_USER: keepuser - POSTGRES_PASSWORD: keeppassword - POSTGRES_DB: keepdb - # To test if imports are working properly - EE_ENABLED: true - -jobs: - tests-e2e: - runs-on: ubuntu-latest - strategy: - matrix: - db_type: [mysql, postgres] - steps: - - name: Checkout - uses: actions/checkout@v3 - - - uses: chartboost/ruff-action@v1 - with: - src: "./keep" - - - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v4 - with: - python-version: ${{ env.PYTHON_VERSION }} - - - name: Install Poetry - uses: snok/install-poetry@v1 - with: - virtualenvs-create: true - virtualenvs-in-project: true - - - name: Cache dependencies - id: cache-deps - uses: actions/cache@v2 - with: - path: .venv - key: pydeps-${{ hashFiles('**/poetry.lock') }} - - - name: Install dependencies using poetry - run: poetry install --no-interaction --no-root --with dev - - - name: Install Playwright dependencies - run: npx playwright install --with-deps - - - name: Install playwright - run: poetry run playwright install - - - name: Expose GitHub Runtime - uses: crazy-max/ghaction-github-runtime@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - driver: docker-container - - - name: Build Docker images - uses: docker/bake-action@v5 - with: - workdir: . - files: | - tests/e2e_tests/docker-compose-e2e-${{ matrix.db_type }}.yml - load: true - - - name: Set up Keep environment - run: | - DOCKER_BUILDKIT=1 docker compose \ - --project-directory . \ - -f tests/e2e_tests/docker-compose-e2e-${{ matrix.db_type }}.yml up -d - - - name: Wait for database to be ready - run: | - # Add commands to wait for the database to be ready - if [ "${{ matrix.db_type }}" == "mysql" ]; then - until docker exec $(docker ps -qf "name=keep-database") mysqladmin ping -h "localhost" --silent; do - echo "Waiting for MySQL to be ready..." - sleep 2 - done - elif [ "${{ matrix.db_type }}" == "postgres" ]; then - until docker exec $(docker ps -qf "name=keep-database") pg_isready -h localhost -U keepuser; do - echo "Waiting for Postgres to be ready..." - sleep 2 - done - fi - - # wait to keep backend on port 8080 - echo "Waiting for Keep backend to be ready..." - attempt=0 - max_attempts=10 - - until $(curl --output /dev/null --silent --fail http://localhost:8080/healthcheck); do - if [ "$attempt" -ge "$max_attempts" ]; then - echo "Max attempts reached, exiting... Sometimes Keep can't start because of double-headed migrations, use: 'alembic -c keep/alembic.ini history' to investigate, or check artifacts." - exit 1 - fi - echo "Waiting for Keep backend to be ready... (Attempt: $((attempt+1)))" - attempt=$((attempt+1)) - sleep 2 - done - - echo "Keep backend is ready!" - # wait to the backend - echo "Waiting for Keep frontend to be ready..." - attempt=0 - max_attempts=10 - - until $(curl --output /dev/null --silent --fail http://localhost:3000/); do - if [ "$attempt" -ge "$max_attempts" ]; then - echo "Max attempts reached, exiting..." - exit 1 - fi - echo "Waiting for Keep frontend to be ready... (Attempt: $((attempt+1)))" - attempt=$((attempt+1)) - sleep 2 - done - - # create the state directory - # mkdir -p ./state && chown -R root:root ./state && chmod -R 777 ./state - - - name: Run e2e tests and report coverage - run: | - poetry run coverage run --branch -m pytest -s tests/e2e_tests/ - - - name: Convert coverage results to JSON (for CodeCov support) - run: poetry run coverage json --omit="keep/providers/*" - - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 - with: - fail_ci_if_error: false # don't fail if we didn't manage to upload the coverage report - files: coverage.json - verbose: true - - - name: Dump backend logs - if: always() - run: | - docker compose --project-directory . -f tests/e2e_tests/docker-compose-e2e-${{ matrix.db_type }}.yml logs keep-backend > backend_logs-${{ matrix.db_type }}.txt - docker compose --project-directory . -f tests/e2e_tests/docker-compose-e2e-${{ matrix.db_type }}.yml logs keep-frontend > frontend_logs-${{ matrix.db_type }}.txt - continue-on-error: true - - - name: Upload test artifacts on failure - if: always() - uses: actions/upload-artifact@v3 - with: - name: test-artifacts - path: | - playwright_dump_*.html - playwright_dump_*.png - backend_logs-${{ matrix.db_type }}.txt - frontend_logs-${{ matrix.db_type }}.txt - continue-on-error: true - - - name: Tear down environment - run: | - docker compose --project-directory . -f tests/e2e_tests/docker-compose-e2e-${{ matrix.db_type }}.yml down From ad86def4414a1397838beb2b100c8bad14c069cb Mon Sep 17 00:00:00 2001 From: Kirill Chernakov Date: Tue, 10 Dec 2024 18:41:32 +0400 Subject: [PATCH 11/24] remove matrix --- .github/workflows/test-pr-e2e-build-and-run.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test-pr-e2e-build-and-run.yml b/.github/workflows/test-pr-e2e-build-and-run.yml index 88c78f58b..e8203607c 100644 --- a/.github/workflows/test-pr-e2e-build-and-run.yml +++ b/.github/workflows/test-pr-e2e-build-and-run.yml @@ -1,4 +1,4 @@ -name: Tests (E2E) +name: Build and up (E2E) on: workflow_dispatch: @@ -24,9 +24,6 @@ env: jobs: tests-e2e: runs-on: ubuntu-latest - strategy: - matrix: - db_type: [mysql, postgres] steps: - name: Checkout uses: actions/checkout@v3 From f8b1a79ba53aee7af2d8da6e716ffa0fd0aa35a6 Mon Sep 17 00:00:00 2001 From: Kirill Chernakov Date: Tue, 10 Dec 2024 18:42:47 +0400 Subject: [PATCH 12/24] remove x-bake from compose --- tests/e2e_tests/docker-compose-e2e-mysql.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tests/e2e_tests/docker-compose-e2e-mysql.yml b/tests/e2e_tests/docker-compose-e2e-mysql.yml index 8ece33a9b..09f73927f 100644 --- a/tests/e2e_tests/docker-compose-e2e-mysql.yml +++ b/tests/e2e_tests/docker-compose-e2e-mysql.yml @@ -22,11 +22,6 @@ services: build: context: ./keep-ui/ dockerfile: ../docker/Dockerfile.ui - x-bake: - cache-from: - - type=gha,scope=frontend - cache-to: - - type=gha,mode=max,scope=frontend environment: - AUTH_TYPE=NO_AUTH - API_URL=http://keep-backend:8080 @@ -40,11 +35,6 @@ services: build: context: . dockerfile: docker/Dockerfile.api - x-bake: - cache-from: - - type=gha,scope=backend - cache-to: - - type=gha,mode=max,scope=backend environment: - AUTH_TYPE=NO_AUTH - DATABASE_CONNECTION_STRING=mysql+pymysql://root:keep@keep-database:3306/keep From c6ab541467c69cfb923d63f7dd28358c49e6ffc5 Mon Sep 17 00:00:00 2001 From: Kirill Chernakov Date: Tue, 10 Dec 2024 18:45:12 +0400 Subject: [PATCH 13/24] no cache --- .github/workflows/test-pr-e2e-build-and-run.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/test-pr-e2e-build-and-run.yml b/.github/workflows/test-pr-e2e-build-and-run.yml index e8203607c..66e25ec16 100644 --- a/.github/workflows/test-pr-e2e-build-and-run.yml +++ b/.github/workflows/test-pr-e2e-build-and-run.yml @@ -47,9 +47,6 @@ jobs: files: | tests/e2e_tests/docker-compose-e2e-mysql.yml load: true - set: | - *.cache-from=type=gha - *.cache-to=type=gha,mode=max - name: Set up Keep environment run: | From 6e43f2c06014d4037d701214fdd33fc0d01f135f Mon Sep 17 00:00:00 2001 From: Kirill Chernakov Date: Tue, 10 Dec 2024 19:05:15 +0400 Subject: [PATCH 14/24] add DOCKER_BUILDKIT=1 --- .github/workflows/test-pr-e2e-build-and-run.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-pr-e2e-build-and-run.yml b/.github/workflows/test-pr-e2e-build-and-run.yml index 66e25ec16..38c9fbcc6 100644 --- a/.github/workflows/test-pr-e2e-build-and-run.yml +++ b/.github/workflows/test-pr-e2e-build-and-run.yml @@ -50,7 +50,7 @@ jobs: - name: Set up Keep environment run: | - docker compose \ + DOCKER_BUILDKIT=1 docker compose \ --project-directory . \ -f tests/e2e_tests/docker-compose-e2e-mysql.yml up -d From c8d63113c81bd67f83237c7cd13da5d65cd7844b Mon Sep 17 00:00:00 2001 From: Kirill Chernakov Date: Tue, 10 Dec 2024 19:16:18 +0400 Subject: [PATCH 15/24] COMPOSE_DOCKER_CLI_BUILD=1 --- .github/workflows/test-pr-e2e-build-and-run.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-pr-e2e-build-and-run.yml b/.github/workflows/test-pr-e2e-build-and-run.yml index 38c9fbcc6..39fa7f6da 100644 --- a/.github/workflows/test-pr-e2e-build-and-run.yml +++ b/.github/workflows/test-pr-e2e-build-and-run.yml @@ -50,7 +50,7 @@ jobs: - name: Set up Keep environment run: | - DOCKER_BUILDKIT=1 docker compose \ + COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose \ --project-directory . \ -f tests/e2e_tests/docker-compose-e2e-mysql.yml up -d From 25530f5429d537a1e6e969a2f6dc87f1e07274ff Mon Sep 17 00:00:00 2001 From: Kirill Chernakov Date: Tue, 10 Dec 2024 19:45:52 +0400 Subject: [PATCH 16/24] extend dockerignore --- .dockerignore | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.dockerignore b/.dockerignore index 282ed0918..ce728ccad 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,7 +1,10 @@ docs/* -keep-ui/node_modules -keep-ui/.next/* -keep-ui/.env.local +**/node_modules +keep-ui/ +tests/ +**/__pycache__ +*.pyc +.git .venv/ .vercel/ .vscode/ From 31e83ec99fd83c01d804d6087bdf7ef34d0a0006 Mon Sep 17 00:00:00 2001 From: Kirill Chernakov Date: Tue, 10 Dec 2024 20:23:10 +0400 Subject: [PATCH 17/24] try depot --- .github/workflows/test-pr-e2e-build-and-run.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-pr-e2e-build-and-run.yml b/.github/workflows/test-pr-e2e-build-and-run.yml index 39fa7f6da..bd423c67c 100644 --- a/.github/workflows/test-pr-e2e-build-and-run.yml +++ b/.github/workflows/test-pr-e2e-build-and-run.yml @@ -35,14 +35,13 @@ jobs: - name: Expose GitHub Runtime uses: crazy-max/ghaction-github-runtime@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - driver: docker-container - - - name: Build Docker images - uses: docker/bake-action@v5 + - name: Set up Depot CLI + uses: depot/setup-action@v1 + + - name: Bake Docker images + uses: depot/bake-action@v1 with: + project: qxmcmqzhnd workdir: . files: | tests/e2e_tests/docker-compose-e2e-mysql.yml From d6867a4b881eea1876335262bc50913099825797 Mon Sep 17 00:00:00 2001 From: Kirill Chernakov Date: Tue, 10 Dec 2024 20:28:19 +0400 Subject: [PATCH 18/24] permissions --- .github/workflows/test-pr-e2e-build-and-run.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-pr-e2e-build-and-run.yml b/.github/workflows/test-pr-e2e-build-and-run.yml index bd423c67c..eafc75fbd 100644 --- a/.github/workflows/test-pr-e2e-build-and-run.yml +++ b/.github/workflows/test-pr-e2e-build-and-run.yml @@ -24,6 +24,9 @@ env: jobs: tests-e2e: runs-on: ubuntu-latest + permissions: + contents: read + id-token: write steps: - name: Checkout uses: actions/checkout@v3 @@ -41,7 +44,6 @@ jobs: - name: Bake Docker images uses: depot/bake-action@v1 with: - project: qxmcmqzhnd workdir: . files: | tests/e2e_tests/docker-compose-e2e-mysql.yml From 7f267a9c73a9dbaa3398a1a400b9298d893fb836 Mon Sep 17 00:00:00 2001 From: Kirill Chernakov Date: Tue, 10 Dec 2024 20:33:25 +0400 Subject: [PATCH 19/24] projectid --- .github/workflows/test-pr-e2e-build-and-run.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-pr-e2e-build-and-run.yml b/.github/workflows/test-pr-e2e-build-and-run.yml index eafc75fbd..89203590a 100644 --- a/.github/workflows/test-pr-e2e-build-and-run.yml +++ b/.github/workflows/test-pr-e2e-build-and-run.yml @@ -44,6 +44,7 @@ jobs: - name: Bake Docker images uses: depot/bake-action@v1 with: + project: qxmcmqzhnd workdir: . files: | tests/e2e_tests/docker-compose-e2e-mysql.yml From 6bec97ae1654e57b821b809cf7515ae290febcae Mon Sep 17 00:00:00 2001 From: Kirill Chernakov Date: Tue, 10 Dec 2024 20:35:07 +0400 Subject: [PATCH 20/24] try run on managed runner --- .github/workflows/test-pr-e2e-build-and-run.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-pr-e2e-build-and-run.yml b/.github/workflows/test-pr-e2e-build-and-run.yml index 89203590a..946c274e1 100644 --- a/.github/workflows/test-pr-e2e-build-and-run.yml +++ b/.github/workflows/test-pr-e2e-build-and-run.yml @@ -23,10 +23,10 @@ env: jobs: tests-e2e: - runs-on: ubuntu-latest permissions: contents: read id-token: write + runs-on: depot-ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 From f407e19c0a276ce7b42f31448d76414ce8ab94fa Mon Sep 17 00:00:00 2001 From: Kirill Chernakov Date: Tue, 10 Dec 2024 20:37:18 +0400 Subject: [PATCH 21/24] Revert "try depot" This reverts commit 31e83ec99fd83c01d804d6087bdf7ef34d0a0006. --- .github/workflows/test-pr-e2e-build-and-run.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-pr-e2e-build-and-run.yml b/.github/workflows/test-pr-e2e-build-and-run.yml index 946c274e1..1bf3b5dc6 100644 --- a/.github/workflows/test-pr-e2e-build-and-run.yml +++ b/.github/workflows/test-pr-e2e-build-and-run.yml @@ -38,13 +38,14 @@ jobs: - name: Expose GitHub Runtime uses: crazy-max/ghaction-github-runtime@v3 - - name: Set up Depot CLI - uses: depot/setup-action@v1 - - - name: Bake Docker images - uses: depot/bake-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver: docker-container + + - name: Build Docker images + uses: docker/bake-action@v5 with: - project: qxmcmqzhnd workdir: . files: | tests/e2e_tests/docker-compose-e2e-mysql.yml From 2b59576dc152145cf223463a949a289df91681c8 Mon Sep 17 00:00:00 2001 From: Kirill Chernakov Date: Tue, 10 Dec 2024 20:42:52 +0400 Subject: [PATCH 22/24] temp add NODE_OPTIONS="--max-old-space-size=8192" --- docker/Dockerfile.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile.ui b/docker/Dockerfile.ui index b0f3aa1a4..7a156a3bb 100644 --- a/docker/Dockerfile.ui +++ b/docker/Dockerfile.ui @@ -24,7 +24,7 @@ ENV NEXT_TELEMETRY_DISABLED 1 # If using npm comment out above and use below instead ENV API_URL http://localhost:8080 -RUN npm run build +RUN NODE_OPTIONS="--max-old-space-size=8192" npm run build # Production image, copy all the files and run next From f741cc8b0c348242319c7572192b7da36c0f1e16 Mon Sep 17 00:00:00 2001 From: Kirill Chernakov Date: Tue, 10 Dec 2024 20:53:10 +0400 Subject: [PATCH 23/24] Revert "Revert "try depot"" This reverts commit f407e19c0a276ce7b42f31448d76414ce8ab94fa. --- .github/workflows/test-pr-e2e-build-and-run.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-pr-e2e-build-and-run.yml b/.github/workflows/test-pr-e2e-build-and-run.yml index 1bf3b5dc6..946c274e1 100644 --- a/.github/workflows/test-pr-e2e-build-and-run.yml +++ b/.github/workflows/test-pr-e2e-build-and-run.yml @@ -38,14 +38,13 @@ jobs: - name: Expose GitHub Runtime uses: crazy-max/ghaction-github-runtime@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - driver: docker-container - - - name: Build Docker images - uses: docker/bake-action@v5 + - name: Set up Depot CLI + uses: depot/setup-action@v1 + + - name: Bake Docker images + uses: depot/bake-action@v1 with: + project: qxmcmqzhnd workdir: . files: | tests/e2e_tests/docker-compose-e2e-mysql.yml From 8c8e938dfef01fcc517aa95d31308c680c9a0453 Mon Sep 17 00:00:00 2001 From: Kirill Chernakov Date: Tue, 10 Dec 2024 20:53:39 +0400 Subject: [PATCH 24/24] use depot with secrets --- .github/workflows/test-pr-e2e-build-and-run.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-pr-e2e-build-and-run.yml b/.github/workflows/test-pr-e2e-build-and-run.yml index 946c274e1..0a03d9109 100644 --- a/.github/workflows/test-pr-e2e-build-and-run.yml +++ b/.github/workflows/test-pr-e2e-build-and-run.yml @@ -44,7 +44,8 @@ jobs: - name: Bake Docker images uses: depot/bake-action@v1 with: - project: qxmcmqzhnd + token: ${{ secrets.DEPOT_TOKEN }} + project: ${{ secrets.DEPOT_PROJECT }} workdir: . files: | tests/e2e_tests/docker-compose-e2e-mysql.yml