Skip to content
Merged
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
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
jobs:
test:
machine:
image: ubuntu-2004:2022.07.1
image: ubuntu-2204:2024.01.2
steps:
- checkout

Expand Down Expand Up @@ -34,18 +34,18 @@ jobs:
- run:
name: Build containers and collect static
command: |
docker-compose -f docker-compose.yml -f docker-compose.selenium.yml up -d
docker-compose -f docker-compose.yml -f docker-compose.selenium.yml exec django python manage.py collectstatic --noinput
docker compose -f docker-compose.yml -f docker-compose.selenium.yml up -d
docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django python manage.py collectstatic --noinput

- run: docker-compose exec django flake8 src/

- run:
name: pytest
command: docker-compose -f docker-compose.yml -f docker-compose.selenium.yml exec django py.test src/ -m "not e2e"
command: docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django py.test src/ -m "not e2e"

- run:
name: e2e tests
command: docker-compose -f docker-compose.yml -f docker-compose.selenium.yml exec django py.test src/tests/functional/ -m e2e
command: docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django py.test src/tests/functional/ -m e2e
no_output_timeout: 60m

- store_artifacts:
Expand Down
9 changes: 9 additions & 0 deletions .env_sample
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ SELENIUM_HOSTNAME=selenium
#DEFAULT_FROM_EMAIL="Codabench <noreply@example.com>"
#SERVER_EMAIL=noreply@example.com


# -----------------------------------------------------------------------------
# Storage
#
Expand All @@ -65,6 +66,7 @@ AWS_STORAGE_PRIVATE_BUCKET_NAME=private
AWS_S3_ENDPOINT_URL=http://minio:9000/
AWS_QUERYSTRING_AUTH=False


# -----------------------------------------------------------------------------
# Limit for re-running submission
# This is used to limit users to rerun submissions
Expand All @@ -73,6 +75,13 @@ AWS_QUERYSTRING_AUTH=False
RERUN_SUBMISSION_LIMIT=30


# -----------------------------------------------------------------------------
# Enable or disbale regular email sign-in an sign-up
# -----------------------------------------------------------------------------
ENABLE_SIGN_UP=True
ENABLE_SIGN_IN=True


# # S3 storage example
# STORAGE_TYPE=s3
# AWS_ACCESS_KEY_ID=12312312312312312331223
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.selenium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
- 36475:36475

selenium:
image: selenium/standalone-firefox-debug:3.141.59
image: selenium/standalone-firefox:124.0
volumes:
- ./src/tests/functional/test_files:/test_files/
- ./artifacts:/artifacts/:z
Expand Down
2 changes: 2 additions & 0 deletions src/apps/api/views/competitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ def get_permissions(self):
def get_serializer_class(self):
if self.action == 'list':
return CompetitionSerializerSimple
if self.action == 'public':
return CompetitionSerializerSimple
elif self.action in ['get_phases', 'results', 'get_leaderboard_frontend_object']:
return LeaderboardPhaseSerializer
elif self.request.method == 'GET':
Expand Down
4 changes: 0 additions & 4 deletions src/apps/profiles/urls_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
urlpatterns = [
url(r'^signup', views.sign_up, name="signup"),
path('login/', views.log_in, name='login'),
# url(r'^user_profile', views.user_profile, name="user_profile"),
# path('login/', auth_views.LoginView.as_view(extra_context=extra_context), name='login'),
# path('login/', views.LoginView.as_view(), name='login'),
# path('logout/', auth_views.LogoutView.as_view(), name='logout'),
path('logout/', views.LogoutView.as_view(), name='logout'),
path('password_reset/', views.CustomPasswordResetView.as_view(), name='password_reset'),
path('password_reset/done/', auth_views.PasswordResetDoneView.as_view(), name='password_reset_done'),
Expand Down
6 changes: 6 additions & 0 deletions src/apps/profiles/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ def activateEmail(request, user, to_email):


def sign_up(request):

# If sign up is not enabled then redirect to login
# this is for security as some users may access sign up page using the url
if not settings.ENABLE_SIGN_UP:
return redirect('accounts:login')

context = {}
context['chahub_signup_url'] = "{}/profiles/signup?next={}/social/login/chahub".format(
settings.SOCIAL_AUTH_CHAHUB_BASE_URL,
Expand Down
7 changes: 7 additions & 0 deletions src/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,3 +469,10 @@
# on default queue when number of submissions are < RERUN_SUBMISSION_LIMIT
# =============================================================================
RERUN_SUBMISSION_LIMIT = os.environ.get('RERUN_SUBMISSION_LIMIT', 30)


# =============================================================================
# Enable or disbale regular email sign-in an sign-up
# =============================================================================
ENABLE_SIGN_UP = os.environ.get('ENABLE_SIGN_UP', 'True').lower() == 'true'
ENABLE_SIGN_IN = os.environ.get('ENABLE_SIGN_IN', 'True').lower() == 'true'
Binary file modified src/static/img/partners/4paradigm.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/static/img/partners/anr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/static/img/partners/anr2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/static/img/partners/barcelona.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/static/img/partners/chalearn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/static/img/partners/cnrs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/static/img/partners/eit_health.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/static/img/partners/google.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/static/img/partners/idf.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/static/img/partners/inria.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/static/img/partners/lisn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/static/img/partners/microsoft.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/static/img/partners/paris-saclay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/static/img/partners/stanford.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/static/riot/profiles/profile_detail.tag
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
<!-- GitHub -->
<div if="{ selected_user.github_url }" class="about-block">
<div class="flex-container">
<div class=""><i class="github icon"></i>Website:</div>
<div class=""><i class="github icon"></i>GitHub:</div>
<div class="value">
<a href="{ selected_user.github_url }" target="_blank">{selected_user.github_url}</a>
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@
</div>
{% else %}
<a href="{% url 'accounts:login' %}" class="ui button style_button item">Login</a>
<a href="{% url 'accounts:signup' %}" class="ui button style_button item">Sign-up</a>
{% if ENABLE_SIGN_UP %}
<a href="{% url 'accounts:signup' %}" class="ui button style_button item">Sign-up</a>
{% endif %}
{% endif %}
</div>
</div>
Expand Down
41 changes: 21 additions & 20 deletions src/templates/pages/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@
{% block top_div_extra_content %}

<div class="ui text container">
<img id="jumbo_logo" src="{% static "img/codabench.png" %}">
<img id="jumbo_logo" src="{% static 'img/codabench.png' %}">
<div class="organization-logos">
<!-- LISN logo -->
<a href="https://www.lisn.upsaclay.fr/" target="_blank">
<img class="organization-logo" src="{% static "img/lisn-logo.svg" %}">
<img class="organization-logo" src="{% static 'img/lisn-logo.svg' %}">
</a>
<!-- Université Paris-Saclay logo -->
<a href="https://www.universite-paris-saclay.fr/" target="_blank">
<img class="organization-logo" src="{% static "img/paris-saclay-logo.svg" %}">
<img class="organization-logo" src="{% static 'img/paris-saclay-logo.svg' %}">
</a>
<!-- CNRS logo -->
<a href="https://www.cnrs.fr/" target="_blank">
<img class="organization-logo" src="{% static "img/cnrs-logo.svg" %}">
<img class="organization-logo" src="{% static 'img/cnrs-logo.svg' %}">
</a>
<!-- Chalearn logo -->
<a href="http://www.chalearn.org/" target="_blank">
<img class="organization-logo" src="{% static "img/chalearn-logo.svg" %}">
<img class="organization-logo" src="{% static 'img/chalearn-logo.svg' %}">
</a>
</div>
</div>
Expand Down Expand Up @@ -233,56 +233,57 @@ <h3 class="news-heading-title">{{post.title}}</h3>
</div>

<!-- Partners Section -->
<!--
<div class="segment-container ui segment full-width">
<div class="ui header">Partners</div>
<div class="container-content" id="partners-row1">
<a href="https://www.universite-paris-saclay.fr/" target="_blank">
<img class="partner-img" src="{% static "img/partners/paris-saclay.png" %}">
<img class="partner-img" src="{% static 'img/partners/paris-saclay.png' %}">
</a>
<a href="https://www.microsoft.com/" target="_blank">
<img class="partner-img" src="{% static "img/partners/microsoft.png" %}">
<img class="partner-img" src="{% static 'img/partners/microsoft.png' %}">
</a>
<a href="http://www.chalearn.org/" target="_blank">
<img class="partner-img" src="{% static "img/partners/chalearn.png" %}">
<img class="partner-img" src="{% static 'img/partners/chalearn.png' %}">
</a>
<a href="http://www.ub.edu/web/ub/en/" target="_blank">
<img class="partner-img" src="{% static "img/partners/barcelona.png" %}">
<img class="partner-img" src="{% static 'img/partners/barcelona.png' %}">
</a>
<a href="https://www.stanford.edu/" target="_blank">
<img class="partner-img" src="{% static "img/partners/stanford.png" %}">
<img class="partner-img" src="{% static 'img/partners/stanford.png' %}">
</a>
<a href="https://www.iledefrance.fr/" target="_blank">
<img class="partner-img" src="{% static "img/partners/idf.jpg" %}">
<img class="partner-img" src="{% static 'img/partners/idf.jpg' %}">
</a>
<a href="https://www.inria.fr/" target="_blank">
<img class="partner-img" src="{% static "img/partners/inria.png" %}">
<img class="partner-img" src="{% static 'img/partners/inria.png' %}">
</a>
</div>
<div class="container-content">
<a href="https://www.lisn.upsaclay.fr/" target="_blank">
<img class="partner-img" src="{% static "img/partners/lisn.png" %}">
<img class="partner-img" src="{% static 'img/partners/lisn.png' %}">
</a>
<a href="https://www.google.com/" target="_blank">
<img class="partner-img" src="{% static "img/partners/google.jpg" %}">
<img class="partner-img" src="{% static 'img/partners/google.jpg' %}">
</a>
<a href="https://en.4paradigm.com/" target="_blank">
<img class="partner-img" src="{% static "img/partners/4paradigm.jpg" %}">
<img class="partner-img" src="{% static 'img/partners/4paradigm.jpg' %}">
</a>
<a href="https://www.cnrs.fr/" target="_blank">
<img class="partner-img" src="{% static "img/partners/cnrs.png" %}">
<img class="partner-img" src="{% static 'img/partners/cnrs.png' %}">
</a>
<a href="https://anr.fr/" target="_blank">
<img class="partner-img" src="{% static "img/partners/anr.png" %}">
<img class="partner-img" src="{% static 'img/partners/anr.png' %}">
</a>
<a href="https://anr.fr/" target="_blank">
<img class="partner-img" src="{% static "img/partners/anr2.jpg" %}">
<img class="partner-img" src="{% static 'img/partners/anr2.jpg' %}">
</a>
<a href="https://www.eithealth.eu/" target="_blank">
<img class="partner-img" src="{% static "img/partners/eit_health.jpg" %}">
<img class="partner-img" src="{% static 'img/partners/eit_health.jpg' %}">
</a>
</div>

</div>
-->

</div>
{% endblock %}
Expand Down
8 changes: 6 additions & 2 deletions src/templates/registration/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

{% block content %}
<div class="sixteen wide mobile six wide computer centered column">
{% if ENABLE_SIGN_IN %}
<h2 class="ui blue centered header">
Login
</h2>
Expand Down Expand Up @@ -52,11 +53,14 @@ <h2 class="ui blue centered header">
</div>
<button class="ui fluid blue submit button" type="submit">Log In</button>
<div class="ui divider"></div>
<p>New to us? <a href="{% url 'accounts:signup' %}">Sign Up</a></p>
{% if ENABLE_SIGN_UP %}
<p>Don't have an account? <a href="{% url 'accounts:signup' %}">Sign Up</a></p>
{% endif %}
<p><a href="{% url 'accounts:password_reset' %}">Forgot your password?</a></p>

<div class="ui error message"></div>
</form>
</div>
{% endif %}
</div>
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion src/tests/functional/test_competitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def current_server_time_exists(self):

# Check that the text is a valid datetime by loading it with strptime.
# This will raise a ValueError if the format is incorrect.
assert datetime.strptime(text, '%B %d, %Y, %I:%M %p %Z')
assert datetime.strptime(text, '%B %d, %Y At %I:%M %p %Z')

def _upload_competition(self, competition_zip_path):
"""Creates a competition and waits for success message.
Expand Down
2 changes: 2 additions & 0 deletions src/utils/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ def common_settings(request):
'USER_JSON_DATA': json.dumps(user_json_data),
'RABBITMQ_MANAGEMENT_URL': f"http://{settings.DOMAIN_NAME}:{settings.RABBITMQ_MANAGEMENT_PORT}",
'FLOWER_URL': f"http://{settings.DOMAIN_NAME}:{settings.FLOWER_PUBLIC_PORT}",
'ENABLE_SIGN_UP': settings.ENABLE_SIGN_UP,
'ENABLE_SIGN_IN': settings.ENABLE_SIGN_IN,
}