Skip to content

Commit

Permalink
Merge pull request #3271 from codalab/develop
Browse files Browse the repository at this point in the history
Merge develop into master
  • Loading branch information
Didayolo authored Nov 8, 2022
2 parents ad57b48 + 4c349e5 commit 7b4d914
Show file tree
Hide file tree
Showing 47 changed files with 699 additions and 1,317 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: codalab-{{ .Branch }}-{{ checksum "codalab/requirements/common.txt" }}
key: codalab-{{ .Branch }}-{{ checksum "codalab/requirements/requirements.txt" }}
- run:
name: CHOWN Python Library Dirs
command: sudo chown -R $(whoami) /usr/local/
Expand All @@ -23,9 +23,9 @@ jobs:
command: sudo apt-get update --allow-releaseinfo-change && sudo apt-get install libmemcached-dev --fix-missing
- run:
name: PIP Install Requirements
command: pip install -r codalab/requirements/common.txt
command: pip install -r codalab/requirements/requirements.txt
- save_cache:
key: codalab-{{ .Branch }}-{{ checksum "codalab/requirements/common.txt" }}
key: codalab-{{ .Branch }}-{{ checksum "codalab/requirements/requirements.txt" }}
paths:
- "~/.cache/pip"
- run:
Expand Down
140 changes: 0 additions & 140 deletions .env_production_sample

This file was deleted.

29 changes: 24 additions & 5 deletions .env_sample
Original file line number Diff line number Diff line change
Expand Up @@ -103,24 +103,43 @@ FLOWER_PORT=5555
# ----------------------------------------------------------------------------
DJANGO_SECRET_KEY=change-me-to-a-secret
DJANGO_PORT=8000
DEBUG=True
NGINX_PORT=80

SSL_PORT=443
#SSL_CERTIFICATE=
#SSL_CERTIFICATE_KEY=
# Allowed hosts separated by space

# Make sure debug is off on production
DEBUG=True
# These admins will be emailed when there are errors
#ADMINS=Name,[email protected];OtherName,[email protected]

# Put SSL certificates in ./certs/ and they are mapped to /app/certs in the container
#SSL_CERTIFICATE=/app/certs/certificate.crt
#SSL_CERTIFICATE_KEY=/app/certs/certificate.pem
# Allowed hosts separated by space (e.g. example.com)
SSL_ALLOWED_HOSTS=

# Set this to your actual domain, like example.com
CODALAB_SITE_DOMAIN=localhost

# How many site workers (submission result processors)?
# A higher value, e.g. 16, is advised for a production environment
WEB_CONCURRENCY=2

# Google Analytics code (leave empty to disable Google's user tracking)
GOOGLE_ANALYTICS=

# =========================================================================
# Email
# =========================================================================
# This section can be left commented for a testing environment
#EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend
#EMAIL_HOST=smtp.sendgrid.net
#EMAIL_HOST_USER=
#EMAIL_HOST_PASSWORD=
#EMAIL_PORT=587
#EMAIL_USE_TLS=True
#DEFAULT_FROM_EMAIL=CodaLab <[email protected]>
#[email protected]

# ----------------------------------------------------------------------------
# Logging
# ----------------------------------------------------------------------------
Expand Down
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip"
directory: "/codalab/requirements"
schedule:
interval: "daily"
83 changes: 83 additions & 0 deletions .github/workflows/run-pytest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Run Pytests
on:
push:
branches:
- master
- develop
pull_request:
jobs:
run-tests:
services:
# Label used to access the service container
postgres:
# Docker Hub image
# use the same version as docker-compose.yml
image: "postgres:12.6-alpine"
# Provide the password for postgres
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: password
POSTGRES_USER: root
POSTGRES_DB: codalab_website
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
memcached:
image: memcached
ports:
- 11211:11211
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8.3
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('common.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Add required host mappings
run: |
echo "127.0.0.1 memcached" | sudo tee --append /etc/hosts
- name: Install dependencies
run: |
sudo apt-get install libxml2-dev libxslt-dev python-dev
sudo apt-get update --allow-releaseinfo-change && sudo apt-get install libmemcached-dev --fix-missing
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov pytest-dependency pytest-django
pip install -r ./codalab/requirements/requirements.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --show-source
- name: Run Tests
env:
DB_ENGINE: "postgresql"
DB_HOST: 127.0.0.1
DB_PORT: "5432"
DB_NAME: "codalab_website"
DB_USER: "root"
DB_PASSWORD: "password"
CHAHUB_API_URL: "http://localhost/test/"
CHAHUB_API_KEY: "some-secret-key"
MEMCACHED_PORT: 11211
working-directory: ./codalab
run: |
#pytest --cov=./ --cov-report=xml
py.test --cov=./ --cov-report=xml
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3

4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ RUN curl -sL https://deb.nodesource.com/setup_4.x | bash -
RUN apt-get update && apt-get install -y npm netcat nodejs python-dev libmemcached-dev

RUN pip install --upgrade pip # make things faster, hopefully

COPY codalab/requirements/common.txt requirements.txt
RUN pip install -r requirements.txt
RUN pip install -r codalab/requirements/requirements.txt

WORKDIR /app/codalab
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
![CodaLab logo](codalab/apps/web/static/img/codalab-logo-fullcolor-positive.png) [![Circle CI](https://circleci.com/gh/codalab/codalab-competitions.svg?style=shield)](https://circleci.com/gh/codalab/codalab-competitions)
[![codecov](https://codecov.io/gh/codalab/codalab-competitions/branch/develop/graph/badge.svg)](https://codecov.io/gh/codalab/codalab-competitions)



Expand Down Expand Up @@ -59,14 +60,8 @@ http://www.opensource.org/licenses/apache2.0.php

```
@article{codalab_competitions,
author = {Adrien Pavao and
Isabelle Guyon and
Anne-Catherine Letournel and
Xavier Baró and
Hugo Escalante and
Sergio Escalera and
Tyler Thomas and
Zhen Xu},
author = {Adrien Pavao and Isabelle Guyon and Anne-Catherine Letournel and Xavier Baró and
Hugo Escalante and Sergio Escalera and Tyler Thomas and Zhen Xu},
title = {CodaLab Competitions: An open source platform to organize scientific challenges},
url = {https://hal.inria.fr/hal-03629462v1},
year = {2022},
Expand Down
6 changes: 6 additions & 0 deletions codalab/apps/api/routers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from apps.api.views import competition_views as views
from apps.api.views import storage_views as storage_views
from apps.api.views import admin_views as admin_views
from django.conf.urls import url
from rest_framework import routers

Expand Down Expand Up @@ -40,4 +41,9 @@
# Storage Analytics
url(r'^storage/analytics', storage_views.GetExistingStorageAnalytics.as_view(), name="existing_storage_analytics"),
url(r'^storage/usage-history', storage_views.GetStorageUsageHistory.as_view(), name="storage_usage_history"),
# Admin
url(r'^admin/competitions/list', admin_views.GetCompetitions.as_view(), name="competitions"),
url(r'^admin/competitions/update', admin_views.UpdateCompetitions.as_view(), name="update_competitions"),
url(r'^admin/competition/(?P<competition_id>\d+)/apply_upper_bound_limit', admin_views.ApplyUpperBoundLimit.as_view(), name="apply_upper_bound_limit"),
url(r'^admin/competitions/default_upper_bound_limit', admin_views.GetDefaultUpperBoundLimit.as_view(), name="get_default_upper_bound_limit")
)
Loading

0 comments on commit 7b4d914

Please sign in to comment.