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
15 changes: 1 addition & 14 deletions compute_worker/compute_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,25 +507,12 @@ async def _run_container_engine_cmd(self, engine_cmd, kind):
websocket = await websockets.connect(self.websocket_url)
websocket_errors = (socket.gaierror, websockets.WebSocketException, websockets.ConnectionClosedError, ConnectionRefusedError)

# Function to read a line, if the line is larger than the buffer size we will
# return the buffer so we can continue reading until we get a newline, rather
# than getting a LimitOverrunError
async def _readline_or_chunk(stream):
try:
return await stream.readuntil(b"\n")
except asyncio.exceptions.IncompleteReadError as e:
# Just return what has been read so far
return e.partial
except asyncio.exceptions.LimitOverrunError as e:
# If we get a LimitOverrunError, we will return the buffer so we can continue reading
return await stream.read(e.consumed)

while any(v["continue"] for k, v in self.logs[kind].items() if k in ['stdout', 'stderr']):
try:
logs = [self.logs[kind][key] for key in ('stdout', 'stderr')]
for value in logs:
try:
out = await asyncio.wait_for(_readline_or_chunk(value["stream"]), timeout=.1)
out = await asyncio.wait_for(value["stream"].readline(), timeout=.1)
if out:
value["data"] += out
print("WS: " + str(out))
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,4 @@ services:
logging:
options:
max-size: "20k"
max-file: "10"
max-file: "10"
6 changes: 0 additions & 6 deletions src/apps/api/serializers/competitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,7 @@ class Meta:
'registration_auto_approve',
'queue',
'enable_detailed_results',
'show_detailed_results_in_submission_panel',
'show_detailed_results_in_leaderboard',
'auto_run_submissions',
'can_participants_make_submissions_public',
'make_programs_available',
'make_input_data_available',
'docker_image',
Expand Down Expand Up @@ -376,10 +373,7 @@ class Meta:
'submission_count',
'queue',
'enable_detailed_results',
'show_detailed_results_in_submission_panel',
'show_detailed_results_in_leaderboard',
'auto_run_submissions',
'can_participants_make_submissions_public',
'make_programs_available',
'make_input_data_available',
'docker_image',
Expand Down
8 changes: 1 addition & 7 deletions src/apps/api/serializers/submissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class SubmissionSerializer(serializers.ModelSerializer):
task = TaskSerializer()
created_when = serializers.DateTimeField(format="%Y-%m-%d %H:%M")
auto_run = serializers.SerializerMethodField(read_only=True)
can_make_submissions_public = serializers.SerializerMethodField(read_only=True)

class Meta:
model = Submission
Expand All @@ -68,8 +67,7 @@ class Meta:
'leaderboard',
'on_leaderboard',
'task',
'auto_run',
'can_make_submissions_public',
'auto_run'
)
read_only_fields = (
'pk',
Expand All @@ -87,10 +85,6 @@ def get_auto_run(self, instance):
# returns this submission's competition auto_run_submissions Flag
return instance.phase.competition.auto_run_submissions

def get_can_make_submissions_public(self, instance):
# returns this submission's competition can_participants_make_submissions_public Flag
return instance.phase.competition.can_participants_make_submissions_public


class SubmissionLeaderBoardSerializer(serializers.ModelSerializer):
scores = SubmissionScoreSerializer(many=True)
Expand Down
6 changes: 3 additions & 3 deletions src/apps/api/views/submissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,15 +352,15 @@ def get_detail_result(self, request, pk):
)
else:
return Response({
"error_msg": "Detailed results are disable for this competition!"},
"error_msg": "Visualizations are disabled"},
status=status.HTTP_404_NOT_FOUND
)

@action(detail=True, methods=('GET',))
def toggle_public(self, request, pk):
submission = super().get_object()
if not submission.phase.competition.can_participants_make_submissions_public:
raise PermissionDenied("You do not have permission to make this submissions public/private")
if not self.has_admin_permission(request.user, submission):
raise PermissionDenied(f'You do not have permission to publish this submissions')
is_public = not submission.is_public
submission.data.is_public = is_public
submission.data.save(send=False)
Expand Down

This file was deleted.

23 changes: 0 additions & 23 deletions src/apps/competitions/migrations/0048_auto_20240401_1646.py

This file was deleted.

7 changes: 0 additions & 7 deletions src/apps/competitions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ class Competition(ChaHubSaveMixin, models.Model):
description = models.TextField(null=True, blank=True)
docker_image = models.CharField(max_length=128, default="codalab/codalab-legacy:py37")
enable_detailed_results = models.BooleanField(default=False)
# If true, show detailed results in submission panel
show_detailed_results_in_submission_panel = models.BooleanField(default=True)
# If true, show detailed results in leaderboard
show_detailed_results_in_leaderboard = models.BooleanField(default=True)
make_programs_available = models.BooleanField(default=False)
make_input_data_available = models.BooleanField(default=False)

Expand All @@ -73,9 +69,6 @@ class Competition(ChaHubSaveMixin, models.Model):
# if false, submissions run will be intiiated by organizer
auto_run_submissions = models.BooleanField(default=True)

# If true, participants see the make their submissions public
can_participants_make_submissions_public = models.BooleanField(default=True)

def __str__(self):
return f"competition-{self.title}-{self.pk}-{self.competition_type}"

Expand Down
2 changes: 0 additions & 2 deletions src/apps/competitions/unpackers/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ def __init__(self, *args, **kwargs):
"description": self.competition_yaml.get("description", ""),
"docker_image": docker_image,
"enable_detailed_results": self.competition_yaml.get('enable_detailed_results', False),
"show_detailed_results_in_submission_panel": self.competition_yaml.get('show_detailed_results_in_submission_panel', True),
"show_detailed_results_in_leaderboard": self.competition_yaml.get('show_detailed_results_in_leaderboard', True),
"auto_run_submissions": self.competition_yaml.get('auto_run_submissions', True),
"make_programs_available": self.competition_yaml.get('make_programs_available', False),
"make_input_data_available": self.competition_yaml.get('make_input_data_available', False),
Expand Down
3 changes: 0 additions & 3 deletions src/apps/competitions/unpackers/v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ def __init__(self, *args, **kwargs):
"registration_auto_approve": self.competition_yaml.get('registration_auto_approve', False),
"docker_image": self.competition_yaml.get('docker_image', 'codalab/codalab-legacy:py37'),
"enable_detailed_results": self.competition_yaml.get('enable_detailed_results', False),
"show_detailed_results_in_submission_panel": self.competition_yaml.get('show_detailed_results_in_submission_panel', True),
"show_detailed_results_in_leaderboard": self.competition_yaml.get('show_detailed_results_in_leaderboard', True),
"auto_run_submissions": self.competition_yaml.get('auto_run_submissions', True),
"can_participants_make_submissions_public": self.competition_yaml.get('can_participants_make_submissions_public', True),
"make_programs_available": self.competition_yaml.get('make_programs_available', False),
"make_input_data_available": self.competition_yaml.get('make_input_data_available', False),
"description": self.competition_yaml.get("description", ""),
Expand Down
Empty file.
6 changes: 0 additions & 6 deletions src/apps/oidc_configurations/admin.py

This file was deleted.

5 changes: 0 additions & 5 deletions src/apps/oidc_configurations/apps.py

This file was deleted.

29 changes: 0 additions & 29 deletions src/apps/oidc_configurations/migrations/0001_initial.py

This file was deleted.

Empty file.
14 changes: 0 additions & 14 deletions src/apps/oidc_configurations/models.py

This file was deleted.

10 changes: 0 additions & 10 deletions src/apps/oidc_configurations/urls.py

This file was deleted.

Loading