Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .coveralls.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
service_name: travis-ci
service_name: github-actions
repo_token: s4vXsUN3KoBjArm1eb7o1jg0RQHYIBr0R
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Our central development branch is development. Coding is done on feature branche

- On your GitHub fork, select your branch and click “New pull request”. Select “master” as the base branch and your branch in the “compare” dropdown.
If the code is mergeable (you get a message saying “Able to merge”), go ahead and create the pull request.
- Check back after some time to see if the Travis checks have passed, if not you should click on “Details” link on your PR thread at the right of “The Travis CI build failed”, which will take you to the dashboard for your PR. You will see what failed / stalled, and will need to resolve them.
- Check back after a few minutes to see if the GitHub Actions workflow has completed. If it hasn’t passed, click the "View details" link next to the failed check in your PR’s Job checks section—this will open the Actions run page for your workflow. There you can review the logs, pinpoint any errors or stalled steps, and fix them before pushing another commit.
- If your checks have passed, your PR will be assigned a reviewer who will review your code and provide comments. Please address each review comment by pushing new commits to the same branch (the PR will automatically update, so you don’t need to submit a new one). Once you are done, comment below each review comment marking it as “Done”. Feel free to use the thread to have a discussion about comments that you don’t understand completely or don’t agree with.

- Once all comments are addressed, the maintainer will approve the PR.
Expand Down
229 changes: 229 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
name: EvalAI CI/CD Pipeline

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

env:
COMPOSE_BAKE: true
COMPOSE_BAKE_ARGS: "--build-arg PIP_NO_CACHE_DIR=1"
CHROME_BIN: chromium-browser
DISPLAY: :99.0
PYTHON_VERSION: '3.9.21'
AWSCLI_VERSION: '1.18.66'
REGISTRY: ${{ secrets.DOCKER_USERNAME }}
IMAGE_TAG: ${{ github.sha }}

jobs:
quality-check:
name: Code Quality & Migration Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python and dependencies
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'

- name: Setup Docker Compose
uses: docker/setup-compose-action@v1
with:
version: latest

- name: Install dependencies and configure system
run: |
pip install --upgrade pip
pip install awscli==${{ env.AWSCLI_VERSION }}
sudo rm -f /etc/boto.cfg
mkdir -p $HOME/.config/pip
echo "[build_ext]" > $HOME/.config/pip/pip.conf
echo "parallel = 1" >> $HOME/.config/pip/pip.conf
ulimit -u 16384
ulimit -n 4096

- name: Run code quality checks
run: |
docker compose run -e DJANGO_SETTINGS_MODULE=settings.dev -e VERBOSE=1 django bash -c "
echo 'Installing black, flake8, pylint and isort...' &&
pip install black==24.8.0 flake8==3.8.2 pylint==3.3.6 isort==5.12.0 &&
echo 'Running black check...' &&
black --check --diff ./ || { echo 'Black check failed!'; exit 1; } &&
echo 'Running isort check...' &&
isort --check-only --diff --profile=black ./ || { echo 'isort check failed!'; exit 1; } &&
echo 'Running flake8 check...' &&
flake8 --config=.flake8 ./ || { echo 'Flake8 check failed!'; exit 1; } &&
echo 'Running pylint check...' &&
pylint --rcfile=.pylintrc --output-format=colorized --score=y --fail-under=7.5 ./ || { echo 'Pylint check failed!'; exit 1; } &&
echo 'All code quality checks passed!'"

- name: Django Migration Check
if: github.event_name == 'pull_request'
run: |
docker compose run -e DJANGO_SETTINGS_MODULE=settings.dev django python manage.py makemigrations --check --dry-run

build-and-push:
name: Build & Push Docker Images
runs-on: ubuntu-latest
# REMOVED: No dependencies - runs in parallel
outputs:
image-digest: ${{ steps.build.outputs.digest }}
steps:
- uses: actions/checkout@v4

- name: Setup Docker Compose
uses: docker/setup-compose-action@v1
with:
version: latest

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-

- name: Docker login
if: github.event_name == 'push'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker images
id: build
run: |
export COMPOSE_DOCKER_CLI_BUILD=1
export DOCKER_BUILDKIT=1

docker compose --profile worker_py3_7 --profile worker_py3_8 --profile worker_py3_9 --profile statsd build ${{ env.COMPOSE_BAKE_ARGS }}

if [ "${{ github.event_name }}" = "push" ]; then
docker compose --profile worker_py3_7 --profile worker_py3_8 --profile worker_py3_9 --profile statsd push
fi

test:
name: Run Tests
runs-on: ubuntu-latest
# REMOVED: No dependencies - runs in parallel with build
strategy:
matrix:
test-type: [frontend, backend]
fail-fast: false
steps:
- uses: actions/checkout@v4

- name: Setup Python and dependencies
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'

- name: Setup Docker Compose
uses: docker/setup-compose-action@v1
with:
version: latest

- name: Install test dependencies
run: |
pip install --upgrade pip
pip install awscli==${{ env.AWSCLI_VERSION }} coveralls

- name: Build images for testing (if not available)
run: |
docker compose --profile worker_py3_7 --profile worker_py3_8 --profile worker_py3_9 --profile statsd build ${{ env.COMPOSE_BAKE_ARGS }}

- name: Setup display for frontend tests
if: matrix.test-type == 'frontend'
run: |
sudo apt-get update
sudo apt-get install -y xvfb chromium-browser
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &

- name: Run frontend tests
if: matrix.test-type == 'frontend'
run: |
docker compose run nodejs bash -c "gulp dev && karma start --single-run && gulp staging"

- name: Run backend tests
if: matrix.test-type == 'backend'
run: |
docker compose run -e DJANGO_SETTINGS_MODULE=settings.test django python manage.py flush --noinput
docker compose run -e DJANGO_SETTINGS_MODULE=settings.test django pytest --cov . --cov-config .coveragerc

- name: Upload coverage to Codecov
if: matrix.test-type == 'backend'
run: |
bash <(curl -s https://codecov.io/bash)

- name: Upload coverage to Coveralls
if: matrix.test-type == 'backend'
continue-on-error: true
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
coveralls --rcfile=.coveragerc

deploy:
name: Package & Deploy Services
runs-on: ubuntu-latest
needs: [build-and-push, test, quality-check] # Waits for ALL jobs to complete
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')
environment: production
steps:
- uses: actions/checkout@v4

- name: Setup Python and dependencies
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'

- name: Install deployment dependencies
run: |
pip install --upgrade pip
pip install awscli==${{ env.AWSCLI_VERSION }}

- name: Configure SSH and decrypt keys
run: |
eval "$(ssh-agent -s)"
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
ssh-keyscan -H ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts

- name: Deploy services
run: |
ssh-add ~/.ssh/deploy_key
./scripts/deployment/push.sh
./scripts/deployment/deploy.sh auto_deploy

- name: Clean up pip cache
run: |
rm -f $HOME/.cache/pip/log/debug.log

- name: Notify on failure
if: failure()
uses: 8398a7/action-slack@v3
with:
status: failure
channel: '#ci-cd'
webhook_url: ${{ secrets.SLACK_WEBHOOK }}

- name: Notify on success
if: success()
uses: 8398a7/action-slack@v3
with:
status: success
channel: '#ci-cd'
webhook_url: ${{ secrets.SLACK_WEBHOOK }}
84 changes: 0 additions & 84 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
------------------------------------------------------------------------------------------

[![Join the chat on Slack](https://img.shields.io/badge/Join%20Slack-Chat-blue?logo=slack)](https://join.slack.com/t/cloudcv-community/shared_invite/zt-3252n6or8-e0QuZKIZFLB0zXtQ6XgxfA)
[![Build Status](https://travis-ci.org/Cloud-CV/EvalAI.svg?branch=master)](https://travis-ci.org/Cloud-CV/EvalAI)
[![Build Status](https://github.com/Cloud-CV/EvalAI/actions/workflows/ci-cd.yml/badge.svg?branch=master)](https://github.com/Cloud-CV/EvalAI/actions/workflows/ci-cd.yml)
[![codecov](https://codecov.io/gh/Cloud-CV/EvalAI/branch/master/graph/badge.svg)](https://codecov.io/gh/Cloud-CV/EvalAI)
[![Coverage Status](https://coveralls.io/repos/github/Cloud-CV/EvalAI/badge.svg)](https://coveralls.io/github/Cloud-CV/EvalAI)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
Expand Down
4 changes: 2 additions & 2 deletions docker/prod/celery/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG AWS_ACCOUNT_ID
ARG COMMIT_ID
ARG TRAVIS_BRANCH
ARG GITHUB_BRANCH_NAME

FROM ${AWS_ACCOUNT_ID}.dkr.ecr.us-east-1.amazonaws.com/evalai-${TRAVIS_BRANCH}-backend:${COMMIT_ID}
FROM ${AWS_ACCOUNT_ID}.dkr.ecr.us-east-1.amazonaws.com/evalai-${GITHUB_BRANCH_NAME}-backend:${COMMIT_ID}

CMD ["sh", "/code/docker/prod/celery/container-start.sh"]
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Our central development branch is development. Coding is done on feature branche

- On your GitHub fork, select your branch and click “New pull request”. Select “master” as the base branch and your branch in the “compare” dropdown.
If the code is mergeable (you get a message saying “Able to merge”), go ahead and create the pull request.
- Check back after some time to see if the Travis checks have passed, if not you should click on “Details” link on your PR thread at the right of “The Travis CI build failed”, which will take you to the dashboard for your PR. You will see what failed / stalled, and will need to resolve them.
- - Check back after a few minutes to see if the GitHub Actions workflow has completed. If it hasn’t passed, click the "View details" link next to the failed check in your PR’s Job checks section—this will open the Actions run page for your workflow. There you can review the logs, pinpoint any errors or stalled steps, and fix them before pushing another commit.
- If your checks have passed, your PR will be assigned a reviewer who will review your code and provide comments. Please address each review comment by pushing new commits to the same branch (the PR will automatically update, so you don’t need to submit a new one). Once you are done, comment below each review comment marking it as “Done”. Feel free to use the thread to have a discussion about comments that you don’t understand completely or don’t agree with.

- Once all comments are addressed, the maintainer will approve the PR.
Expand Down
11 changes: 6 additions & 5 deletions docs/source/contribution.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,12 @@ reviewed. To submit code, follow these steps:
the “compare” dropdown. If the code is mergeable (you get a
message saying “Able to merge”), go ahead and create the pull
request.
- Check back after some time to see if the Travis checks have
passed, if not you should click on “Details” link on your PR
thread at the right of “The Travis CI build failed”, which will
take you to the dashboard for your PR. You will see what failed /
stalled, and will need to resolve them.
- Check back after a few minutes to see if the GitHub Actions
workflow has completed. If it hasn’t passed, click the "View details"
link next to the failed check in your PR’s Job checks section—this
will open the Actions run page for your workflow. There you can review
the logs, pinpoint any errors or stalled steps, and fix them before
pushing another commit.
- If your checks have passed, your PR will be assigned a reviewer
who will review your code and provide comments. Please address
each review comment by pushing new commits to the same branch (the
Expand Down
4 changes: 2 additions & 2 deletions frontend_v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Revamped codebase of EvalAI Frontend

### For deploying with [Surge](https://surge.sh/):

Surge will automatically generate deployment link whenever a pull request passes Travis CI.
Surge will automatically generate deployment link whenever a pull request passes Github Actions.

Suppose pull request number is 123 and it passes Travis CI. The deployment link can be found here: `https://pr-123-evalai.surge.sh`
Suppose pull request number is 123 and it passes Github Actions. The deployment link can be found here: `https://pr-123-evalai.surge.sh`

## Code scaffolding

Expand Down
Loading
Loading