Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address feedback from previous PRs #172

Merged
merged 2 commits into from
Oct 30, 2024
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
3 changes: 1 addition & 2 deletions frx_challenges/web/management/commands/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import aiodocker
import aiodocker.containers
import fsspec
from asgiref.sync import sync_to_async
from django.conf import settings
from django.core.management.base import BaseCommand
from django.db.models import Exists, OuterRef, Q
Expand Down Expand Up @@ -189,7 +188,7 @@ async def ahandle(self):

# Get the number of running evaluations
# This is a synchronous operation so it's wrapped in sync_to_async
num = await sync_to_async(running_evaluations.count)()
num = await running_evaluations.acount()
async for e in unstarted_evaluations:
# Only start a new evaluation if the number of running evaluations is less than the maximum
if num < settings.MAX_RUNNING_EVALUATIONS:
Expand Down
7 changes: 2 additions & 5 deletions helm-chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,17 @@ spec:
subPath: frx_challenges.yaml
- name: staticfiles
mountPath: /opt/staticfiles
{{- if .Values.adminUsers }}
- name: admin-add
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
{{- if .Values.adminUsers }}
- python
- manage.py
- promote
{{- range .Values.adminUsers }}
- {{ . }}
{{- end }}
{{- else }}
- echo
- "No admin users to add"
{{- end }}
securityContext:
runAsUser: 0
volumeMounts:
Expand All @@ -79,6 +75,7 @@ spec:
- name: django-yamlconf
mountPath: /opt/frx-challenges/frx_challenges/frx_challenges.yaml
subPath: frx_challenges.yaml
{{- end }}
{{ with .Values.extraInitContainers }}
{{ $extraInitContainers := . }}
{{ $sortedKeys := keys $extraInitContainers | sortAlpha }}
Expand Down