Skip to content

expunge monitor in scheduler #1877

expunge monitor in scheduler

expunge monitor in scheduler #1877

Workflow file for this run

# ----------------------------------------------------------------------------
# Copyright (C) 2021-2022 Deepchecks (https://www.deepchecks.com)
#
# This file is part of Deepchecks.
# Deepchecks is distributed under the terms of the GNU Affero General
# Public License (version 3 or later).
# You should have received a copy of the GNU Affero General Public License
# along with Deepchecks. If not, see <http://www.gnu.org/licenses/>.
# ----------------------------------------------------------------------------
#
name: PR Tests
env:
DISABLE_DEEPCHECKS_ANONYMOUS_TELEMETRY: "true"
on:
pull_request:
branches:
- main
push:
branches:
- main
# Manual run
workflow_dispatch:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
if: "!github.event.pull_request.draft"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ secrets.MON_IMAGE_NAME }}:${{ github.sha }}
build-args: |
DEEPCHECKS_CI_TOKEN=${{ secrets.DEEPCHECKS_CI_TOKEN }}
MIXPANEL_ID=${{ secrets.MIXPANEL_ID }}
outputs: type=docker,dest=/tmp/commImage.tar
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: commImage
path: /tmp/commImage.tar
docker-push:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Configure AWS credentials (Public)
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Login to Amazon ECR Public
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@v1
with:
registry-type: public
# Sadly, buildx does not support loading images from file to reuse the image from the previous step
# https://github.com/docker/buildx/issues/847
- name: Build and push - private
uses: docker/build-push-action@v4
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64/v8
push: true
tags: |
${{ secrets.MON_IMAGE_NAME }}:${{ github.sha }}
${{ secrets.MON_IMAGE_NAME }}:latest
build-args: |
DEEPCHECKS_CI_TOKEN=${{ secrets.DEEPCHECKS_CI_TOKEN }}
MIXPANEL_ID=${{ secrets.MIXPANEL_ID }}
- name: Build and push - public
uses: docker/build-push-action@v4
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64/v8
push: true
tags: |
${{ secrets.PUBLIC_IMAGE_NAME }}:${{ github.sha }}
${{ secrets.PUBLIC_IMAGE_NAME }}:latest
build-args: |
DEEPCHECKS_CI_TOKEN=${{ secrets.DEEPCHECKS_CI_TOKEN }}
MIXPANEL_ID=${{ secrets.MIXPANEL_ID }}
IS_DEEPCHECKS_OSS="true"
- name: Logout from Amazon ECR
if: always()
run: |
docker logout ${{ steps.login-ecr.outputs.registry }}
docker logout ${{ steps.login-ecr-public.outputs.registry }}
dev-deploy:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
needs: docker-push
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1
- name: Download task definition
run: |
aws ecs describe-task-definition --task-definition mon-commercial --query taskDefinition > task-definition.json
- name: Fill in the new image ID in the Amazon ECS task definition - app
id: render-app-container
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: task-definition.json
container-name: server
image: ${{ secrets.MON_IMAGE_NAME }}:${{ github.sha }}
- name: Fill in the new image ID in the Amazon ECS task definition - alert-scheduler
id: render-alert-scheduler-container
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ${{ steps.render-app-container.outputs.task-definition }}
container-name: alert-scheduler
image: ${{ secrets.MON_IMAGE_NAME }}:${{ github.sha }}
- name: Fill in the new image ID in the Amazon ECS task definition - task queuer
id: render-task-queuer-container
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ${{ steps.render-alert-scheduler-container.outputs.task-definition }}
container-name: task-queuer
image: ${{ secrets.MON_IMAGE_NAME }}:${{ github.sha }}
- name: Fill in the new image ID in the Amazon ECS task definition - task runner
id: render-task-runner-container
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ${{ steps.render-task-queuer-container.outputs.task-definition }}
container-name: task-runner
image: ${{ secrets.MON_IMAGE_NAME }}:${{ github.sha }}
- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.render-task-runner-container.outputs.task-definition }}
service: mon-commercial
cluster: DevMonitoring
e2e:
runs-on: ubuntu-latest-4-cores
needs: build
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: commImage
path: /tmp
- name: Load Docker image
run: |
docker load --input /tmp/commImage.tar
docker tag ${{ secrets.MON_IMAGE_NAME }}:${{ github.sha }} deepchecks-enterprise-testing
docker image ls -a
# - name: Run e2e tests // TODO: Uncomment when we fix e2e tests
# env:
# LAUCHDARKLY_SDK_KEY: ${{ secrets.LAUCHDARKLY_SDK_KEY }}
# OAUTH_CLIENT_ID: ${{ secrets.OAUTH_CLIENT_ID }}
# OAUTH_CLIENT_SECRET: ${{ secrets.OAUTH_CLIENT_SECRET }}
# run: make cypress
- name: Upload artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: cypress-artifacts
path: |
./cypress/screenshots
./cypress/videos
retention-days: 1
docs:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout deepchecks
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Install pandoc
run: |
sudo apt-get update
sudo apt-get install pandoc dvisvgm texlive texlive-latex-extra postgresql-client docker-compose
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: commImage
path: /tmp
- name: Load Docker image
run: |
docker load --input /tmp/commImage.tar
docker tag ${{ secrets.MON_IMAGE_NAME }}:${{ github.sha }} deepchecks-enterprise-testing
docker image ls -a
- name: Setup environment
run: |
make external-services-setup
- name: DB load
run: |
docker run --env-file e2e/.development.env --network deepchecks deepchecks-enterprise-testing init-test-db.sh
echo "DEEPCHECKS_API_TOKEN=ZTJlLXRlc3RpbmdAZGVlcGNoZWNrcy5jb20=.ASB8rB13J5i_4Nma7zZfIA" >> $GITHUB_ENV
echo "DEEPCHECKS_API_HOST=http://127.0.0.1:8000" >> $GITHUB_ENV
env:
DEEPCHECKS_CI_TOKEN: ${{ secrets.DEEPCHECKS_CI_TOKEN }}
- name: Build documentation
env:
DEEPCHECKS_CI_TOKEN: ${{ secrets.DEEPCHECKS_CI_TOKEN }}
DEEPCHECKS_API_TOKEN: ${{ env.DEEPCHECKS_API_TOKEN }}
DEEPCHECKS_API_HOST: ${{ env.DEEPCHECKS_API_HOST }}
LAUCHDARKLY_SDK_KEY: ${{ secrets.LAUCHDARKLY_SDK_KEY }}
OAUTH_CLIENT_ID: ${{ secrets.OAUTH_CLIENT_ID }}
OAUTH_CLIENT_SECRET: ${{ secrets.OAUTH_CLIENT_SECRET }}
run: |
make env-setup
make docs
# - name: Debugging with ssh
# uses: lhotari/action-upterm@v1
# with:
# ## limits ssh access and adds the ssh public key for the user which triggered the workflow
# limit-access-to-actor: true
# env:
# DEEPCHECKS_CI_TOKEN: ${{ secrets.DEEPCHECKS_CI_TOKEN }}
# DEEPCHECKS_API_TOKEN: ${{ env.DEEPCHECKS_API_TOKEN }}
# DEEPCHECKS_API_HOST: ${{ env.DEEPCHECKS_API_HOST }}
- name: Print errors
if: always()
run: cat docs/docs.error.log
- name: Print server logs
if: always()
run: docker logs `docker ps | grep :8000 | awk '{print $1}'`
- name: Checkout deepchecks.github.io
if: github.event_name != 'pull_request'
uses: actions/checkout@v2
with:
repository: deepchecks/deepchecks.github.io
path: deepchecks.github.io
token: ${{ secrets.DEEPCHECKS_CI_TOKEN }}
- name: Push documentation
if: github.event_name != 'pull_request'
run: ${{ github.workspace }}/.github/scripts/push_docs.sh