Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gradingscript
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Joshua Randall
gradingscript
Commits
ad8dc02f
Commit
ad8dc02f
authored
7 months ago
by
joshrandall8478
Browse files
Options
Downloads
Patches
Plain Diff
close to success
parent
859a0426
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.dockerignore
+5
-0
5 additions, 0 deletions
.dockerignore
docker-compose.yml
+12
-0
12 additions, 0 deletions
docker-compose.yml
gradingscript.dockerfile
+17
-0
17 additions, 0 deletions
gradingscript.dockerfile
main.py
+13
-8
13 additions, 8 deletions
main.py
with
47 additions
and
8 deletions
.dockerignore
0 → 100644
+
5
−
0
View file @
ad8dc02f
.venv
.vscode
.gitignore
docker-compose.yml
gradingscript.Dockerfile
\ No newline at end of file
This diff is collapsed.
Click to expand it.
docker-compose.yml
0 → 100644
+
12
−
0
View file @
ad8dc02f
services
:
app
:
image
:
gradingscript:latest
build
:
context
:
.
dockerfile
:
./gradingscript.dockerfile
environment
:
ASSIGNMENT_TITLE
:
"
Assignment
Title"
SCORE_DEFAULT
:
100
LATE_PENALTY
:
8
DEFAULT_POINTS
:
"
[[10],[15,20],[0]]"
DEFAULT_LABELS
:
"
['Name',
'Steps',
'Extra
Credit']"
\ No newline at end of file
This diff is collapsed.
Click to expand it.
gradingscript.dockerfile
0 → 100644
+
17
−
0
View file @
ad8dc02f
# Use the official Python image from the Docker Hub
FROM
python:3.9-slim
# Set the working directory in the container
WORKDIR
/app
# Copy the requirements file into the container
COPY
requirements.txt .
# Install the dependencies
RUN
pip3
install
--no-cache-dir
-r
requirements.txt
# Copy the rest of the application code into the container
COPY
. .
# Specify the command to run the application
CMD
["python3", "main.py"]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
main.py
+
13
−
8
View file @
ad8dc02f
...
@@ -4,6 +4,7 @@ from colored import Fore, Style #Documentation: https://dslackw.gitlab.io/colore
...
@@ -4,6 +4,7 @@ from colored import Fore, Style #Documentation: https://dslackw.gitlab.io/colore
from
time
import
sleep
from
time
import
sleep
import
os
import
os
import
json
"""
"""
...
@@ -28,8 +29,12 @@ Environment Variable Imports
...
@@ -28,8 +29,12 @@ Environment Variable Imports
title
=
os
.
getenv
(
"
ASSIGNMENT_TITLE
"
,
default
=
"
Assignment Title
"
)
title
=
os
.
getenv
(
"
ASSIGNMENT_TITLE
"
,
default
=
"
Assignment Title
"
)
scoreDefault
=
os
.
getenv
(
"
SCORE_DEFAULT
"
,
default
=
100
)
# What the score is out of
scoreDefault
=
os
.
getenv
(
"
SCORE_DEFAULT
"
,
default
=
100
)
# What the score is out of
latePenalty
=
scoreDefault
*
float
(
os
.
getenv
(
"
LATE_PENALTY
"
,
default
=
"
0.1
"
))
latePenalty
=
int
(
os
.
getenv
(
"
LATE_PENALTY
"
,
default
=
"
8
"
))
defaults
=
os
.
getenv
(
"
POINTS_FOR_RUNS
"
,
default
=
[
10
,
20
,
0
])
# defaults = os.getenv("POINTS_FOR_RUNS", default=[10,20,0])
defaults_env
=
os
.
getenv
(
"
DEFAULT_POINTS
"
,
default
=
"
[[10],[15,20],[0]]
"
)
defaults
=
json
.
loads
(
defaults_env
)
defaultLabels_env
=
os
.
getenv
(
"
DEFAULT_LABELS
"
,
default
=
'
[
"
Name
"
,
"
Steps
"
,
"
Extra Credit
"
]
'
)
defaultLabels
=
json
.
loads
(
defaultLabels_env
)
"""
"""
* CHANGEABLE
* CHANGEABLE
"""
"""
...
@@ -43,16 +48,16 @@ defaults = os.getenv("POINTS_FOR_RUNS", default=[10,20,0])
...
@@ -43,16 +48,16 @@ defaults = os.getenv("POINTS_FOR_RUNS", default=[10,20,0])
# Default points stored for each run. Each list entry is a run. A default run score of 0 allows extra credit.
# Default points stored for each run. Each list entry is a run. A default run score of 0 allows extra credit.
defaultLabels
=
[
"
Name
"
,
"
Steps
"
,
"
Extra Credit
"
]
#
defaultLabels = ["Name", "Steps", "Extra Credit"]
defaults
=
[
#
defaults = [
[
10
],
#
[10],
[
15
,
20
],
#
[15,20],
[
0
]]
#
[0]]
# Late penalty if submission is late. 0 for no penalty
# Late penalty if submission is late. 0 for no penalty
latePenalty
=
8
# 10% of score default
#
latePenalty = 8 # 10% of score default
"""
"""
! NON CHANGEABLE
! NON CHANGEABLE
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment