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

Upgrade Playground #284

Merged
merged 54 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
505dd2e
Bump next from 13.5.6 to 14.1.1 in /playground
dependabot[bot] May 10, 2024
80cc39a
Merge branch 'develop' into dependabot/npm_and_yarn/playground/next-1…
maximiliansoelch May 11, 2024
7769e87
use unique keys across artemis instances
dmytropolityka May 12, 2024
88e5ba7
set values from .env and .ini
dmytropolityka May 13, 2024
cfc9f1f
change authorization process
dmytropolityka May 19, 2024
a376fcb
extend database to store artemis url
dmytropolityka May 19, 2024
d356749
fix bugs
dmytropolityka May 19, 2024
1757ea8
Merge branch 'develop' into feature/decouple-artemis-from-athena
dmytropolityka May 19, 2024
7df5183
fix linting issues
dmytropolityka May 19, 2024
6f837a1
add further deployments
dmytropolityka May 19, 2024
749aeae
remove dotenv
dmytropolityka May 19, 2024
cf8bd83
remove dotenv and unused code
dmytropolityka May 19, 2024
9348bf3
adjust deployment units
dmytropolityka May 19, 2024
f014359
make deployments not compulsory
dmytropolityka May 19, 2024
76df5d9
bugs
dmytropolityka May 20, 2024
bc293fa
more logging
dmytropolityka May 20, 2024
61dfd0a
more logging
dmytropolityka May 20, 2024
92b5424
fix bug
dmytropolityka May 20, 2024
2db5fa9
rename unique constraint
dmytropolityka May 20, 2024
c95634f
Update __main__.py
dmytropolityka May 27, 2024
646d51e
Merge branch 'develop' into dependabot/npm_and_yarn/playground/next-1…
maximiliansoelch May 27, 2024
1f552cc
Bump mysql2 from 3.9.7 to 3.9.8 in /playground
dependabot[bot] May 30, 2024
af34b89
rename artemis_url to lms_url
dmytropolityka Jun 2, 2024
4ae0c27
Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/playgrou…
dmytropolityka Jun 2, 2024
e0be309
make playground work for multi-instance setup; add non-graded feedbac…
dmytropolityka Jun 2, 2024
8fb8fd1
Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/playgrou…
dmytropolityka Jun 3, 2024
ea0696e
Merge branch 'develop' into feature/decouple-artemis-from-athena
maximiliansoelch Jun 6, 2024
c74b112
rename artemis_url into lms_url, further occurrences
dmytropolityka Jun 7, 2024
0f45254
rename artemis into lms, further occurrences
dmytropolityka Jun 7, 2024
4324ea6
Merge branch 'develop' into feature/decouple-artemis-from-athena
dmytropolityka Jun 7, 2024
7f1a317
update user and key
dmytropolityka Jun 7, 2024
2cb90bc
Revert "update user and key"
dmytropolityka Jun 9, 2024
d93daf7
remove unnecessary yarn lock file
dmytropolityka Jun 9, 2024
8fad620
Merge remote-tracking branch 'origin/feature/playground-self-learning…
dmytropolityka Jun 9, 2024
ce88507
Merge branch 'feature/decouple-artemis-from-athena' into feature/play…
dmytropolityka Jun 9, 2024
d763ed1
update experiments
dmytropolityka Jun 9, 2024
cd2474b
remove server config prior to deployment
dmytropolityka Jun 9, 2024
c997586
adapt dockerfile
dmytropolityka Jun 21, 2024
6f60c8b
add debug statement
dmytropolityka Jun 24, 2024
0aeab86
modify dockerfile
dmytropolityka Jun 24, 2024
892057e
change signature of suggest_feedback for other modules
dmytropolityka Jul 2, 2024
17e872a
Merge remote-tracking branch 'origin/feature/playground-self-learning…
dmytropolityka Jul 2, 2024
b28265d
add localhost to server configuration
dmytropolityka Jul 5, 2024
21b1249
modules have information whether they support non graded feedback req…
dmytropolityka Jul 7, 2024
8c2bc65
add differentiation whether to include to client code
dmytropolityka Jul 7, 2024
6229a4b
fix mypy error
dmytropolityka Jul 7, 2024
790c07c
Merge branch 'develop' into feature/playground-self-learning-feedback
FelixTJDietrich Jul 15, 2024
62b66cd
Merge branch 'develop' into feature/playground-self-learning-feedback
FelixTJDietrich Jul 15, 2024
653e8e5
Merge branch 'develop' into feature/playground-self-learning-feedback
FelixTJDietrich Jul 16, 2024
ba8d0e9
Update Dockerfile
dmytropolityka Jul 17, 2024
fb795cd
update default port
dmytropolityka Jul 19, 2024
059bbe8
revert merged dockerfile
dmytropolityka Jul 19, 2024
058968a
add "support graded feedback suggestions" flag
dmytropolityka Jul 26, 2024
ae65738
fix wrongly initialized repository flag
dmytropolityka Jul 26, 2024
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
8 changes: 5 additions & 3 deletions assessment_module_manager/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ RUN poetry config virtualenvs.create true \
COPY . ./

# Use modules configuration file for docker
RUN mv ./modules.docker.ini ./modules.ini
RUN cp ./modules.docker.ini ./modules.ini
RUN rm ./modules.docker.ini

# Use deployments configuration file for docker
RUN mv ./deployments.docker.ini ./deployments.ini
RUN cp ./deployments.docker.ini ./deployments.ini
RUN rm ./deployments.docker.ini

# poetry scripts don't work here
CMD poetry run python -m assessment_module_manager
CMD poetry run python -m assessment_module_manager
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ class HealthResponse(BaseModel):
"url": "http://localhost:5001",
"type": "programming",
"healthy": True,
"supportsEvaluation": True
"supportsEvaluation": True,
"supportsNonGradedFeedbackRequests": True,
"supportsGradedFeedbackRequests": True
}
}
]
Expand All @@ -58,7 +60,9 @@ async def get_health() -> HealthResponse:
"url": module.url,
"type": module.type,
"healthy": await is_healthy(module),
"supportsEvaluation": module.supports_evaluation
"supportsEvaluation": module.supports_evaluation,
"supportsNonGradedFeedbackRequests": module.supports_non_graded_feedback_requests,
"supportsGradedFeedbackRequests": module.supports_graded_feedback_requests
}
for module in get_modules()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def list_modules() -> List[Module]:
url=cast(AnyHttpUrl, os.environ.get(f"{module.upper()}_URL", modules_config[module]["url"])),
type=ExerciseType(modules_config[module]["type"]),
supports_evaluation=modules_config[module].getboolean("supports_evaluation"),
supports_non_graded_feedback_requests=modules_config[module].getboolean("supports_non_graded_feedback_requests"),
supports_graded_feedback_requests=modules_config[module].getboolean("supports_graded_feedback_requests")
)
for module in modules_config.sections()
]
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ class Module(BaseModel):
url: AnyHttpUrl = Field(example="http://localhost:5001")
type: ExerciseType = Field(example=ExerciseType.text)
supports_evaluation: bool = Field(description="Whether the module supports evaluation", example=True)
supports_non_graded_feedback_requests: bool = Field(description="Whether the module supports non-graded feedback requests", example=True),
supports_graded_feedback_requests: bool = Field(description="Whether the module supports graded feedback requests", example=True)
8 changes: 7 additions & 1 deletion assessment_module_manager/deployments.docker.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
[schwind]
url = https://ma-schwind.ase.cit.tum.de
url = https://ma-schwind.ase.cit.tum.de

[playground]
url = https://athenetest1-03.ase.cit.tum.de

[localhost]
url = http://localhost:3000
5 changes: 4 additions & 1 deletion assessment_module_manager/deployments.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# for local development only

[local]
url = http://localhost:8080
url = http://localhost:8080

[playground]
url = http://localhost:3000
14 changes: 14 additions & 0 deletions assessment_module_manager/modules.docker.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,47 @@
url = http://module-example:5001
type = programming
supports_evaluation = true
supports_non_graded_feedback_requests = false
FelixTJDietrich marked this conversation as resolved.
Show resolved Hide resolved
supports_graded_feedback_requests = false

[module_programming_llm]
url = http://module-programming-llm:5002
type = programming
supports_evaluation = false
supports_non_graded_feedback_requests = true
supports_graded_feedback_requests = true

[module_text_llm]
url = http://module-text-llm:5003
type = text
supports_evaluation = true
supports_non_graded_feedback_requests = false
supports_graded_feedback_requests = true

[module_text_cofee]
url = http://module-text-cofee:5004
type = text
supports_evaluation = false
supports_non_graded_feedback_requests = false
supports_graded_feedback_requests = true

[module_programming_themisml]
url = http://module-programming-themisml:5005
type = programming
supports_evaluation = false
supports_non_graded_feedback_requests = false
supports_graded_feedback_requests = true

[module_programming_apted]
url = http://module-programming-apted:5006
type = programming
supports_evaluation = false
supports_non_graded_feedback_requests = false
supports_graded_feedback_requests = false

[module_modeling_llm]
url = http://module-modeling-llm:5008
type = modeling
supports_evaluation = false
supports_non_graded_feedback_requests = false
supports_graded_feedback_requests = true
14 changes: 14 additions & 0 deletions assessment_module_manager/modules.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,47 @@
url = http://localhost:5001
type = programming
supports_evaluation = true
supports_non_graded_feedback_requests = false
supports_graded_feedback_requests = false

[module_programming_llm]
url = http://localhost:5002
type = programming
supports_evaluation = false
supports_non_graded_feedback_requests = true
supports_graded_feedback_requests = true

[module_text_llm]
url = http://localhost:5003
type = text
supports_evaluation = true
supports_non_graded_feedback_requests = false
supports_graded_feedback_requests = true

[module_text_cofee]
url = http://localhost:5004
type = text
supports_evaluation = false
supports_non_graded_feedback_requests = false
supports_graded_feedback_requests = true

[module_programming_themisml]
url = http://localhost:5005
type = programming
supports_evaluation = false
supports_non_graded_feedback_requests = false
supports_graded_feedback_requests = true

[module_programming_apted]
url = http://localhost:5006
type = programming
supports_evaluation = false
supports_non_graded_feedback_requests = false
supports_graded_feedback_requests = false

[module_modeling_llm]
url = http://localhost:5008
type = modeling
supports_evaluation = false
supports_non_graded_feedback_requests = false
supports_graded_feedback_requests = true
4 changes: 2 additions & 2 deletions athena/athena/schemas/feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class Feedback(Schema, ABC):
exercise_id: int = Field(example=1)
submission_id: int = Field(example=1)

def to_model(self, is_suggestion: bool = False, lms_id: Optional[int] = None):
return type(self).get_model_class()(**self.dict(), is_suggestion=is_suggestion, lms_id=lms_id)
def to_model(self, is_suggestion: bool = False, lms_id: Optional[int] = None, lms_url: Optional[str] = None):
return type(self).get_model_class()(**self.dict(), is_suggestion=is_suggestion, lms_id=lms_id, lms_url=lms_url)

class Config:
orm_mode = True
2 changes: 1 addition & 1 deletion athena/athena/storage/feedback_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def store_feedback(feedback: Feedback, is_lms_id=False, lms_url: Optional[str] =
lms_url=lms_url).scalar()
feedback.id = internal_id

stored_feedback_model = db.merge(feedback.to_model(lms_id=lms_id))
stored_feedback_model = db.merge(feedback.to_model(lms_id=lms_id, lms_url=lms_url))
db.commit()
return stored_feedback_model.to_schema()

Expand Down
2 changes: 1 addition & 1 deletion env_example/assessment_module_manager.env
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ MODULE_PROGRAMMING_THEMISML_SECRET=12345abcdef
# LMS Deployments #
################################################################
# the deployment name should correspond to the name in deployments.ini
LMS_DEPLOYMENT_NAME_SECRET=12345abcdef
LMS_DEPLOYMENT_NAME_SECRET=12345abcdef
2 changes: 1 addition & 1 deletion module_modeling_llm/module_modeling_llm/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def process_incoming_feedback(exercise: Exercise, submission: Submission, feedba


@feedback_provider
async def suggest_feedback(exercise: Exercise, submission: Submission, module_config: Configuration) -> List[Feedback]:
async def suggest_feedback(exercise: Exercise, submission: Submission, is_graded: bool, module_config: Configuration) -> List[Feedback]:
FelixTJDietrich marked this conversation as resolved.
Show resolved Hide resolved
logger.info("suggest_feedback: Suggestions for submission %d of exercise %d were requested", submission.id,
exercise.id)
return await generate_suggestions(exercise, submission, module_config.approach, module_config.debug)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async def generate_summary_by_file(
model=model,
system_message=config.generate_file_summary_prompt.system_message,
human_message=config.generate_file_summary_prompt.human_message,
pydantic_object=FileDescription,
pydantic_object=SolutionSummary,
)

prompt_inputs = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ async def split_problem_statement_by_file(
"changed_files_from_template_to_submission": ", ".join(changed_files_from_template_to_submission)
}

if "changed_files_from_template_to_solution" in prompt.input_variables:
if "changed_files_from_template_to_solution" in chat_prompt.input_variables:
solution_repo = exercise.get_solution_repository()
changed_files_from_template_to_solution = get_diff(
src_repo=template_repo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def process_incoming_feedback(exercise: Exercise, submission: Submission, feedba


@feedback_provider
async def suggest_feedback(exercise: Exercise, submission: Submission) -> List[Feedback]:
async def suggest_feedback(exercise: Exercise, submission: Submission, is_graded: bool = True) -> List[Feedback]:
logger.info("suggest_feedback: Suggestions for submission %d of exercise %d were requested", submission.id, exercise.id)

# ThemisML currently only works with Java
Expand Down
2 changes: 1 addition & 1 deletion module_text_cofee/module_text_cofee/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def process_incoming_feedback(exercise: Exercise, submission: Submission, feedba


@feedback_provider
def suggest_feedback(exercise: Exercise, submission: Submission) -> List[Feedback]:
def suggest_feedback(exercise: Exercise, submission: Submission, is_graded: bool = True) -> List[Feedback]:
logger.info(
"suggest_feedback: Suggestions for submission %d of exercise %d were requested",
submission.id, exercise.id
Expand Down
5 changes: 3 additions & 2 deletions module_text_llm/module_text_llm/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ def process_incoming_feedback(exercise: Exercise, submission: Submission, feedba


@feedback_provider
async def suggest_feedback(exercise: Exercise, submission: Submission, module_config: Configuration) -> List[Feedback]:
logger.info("suggest_feedback: Suggestions for submission %d of exercise %d were requested", submission.id, exercise.id)
async def suggest_feedback(exercise: Exercise, submission: Submission, is_graded: bool, module_config: Configuration) -> List[Feedback]:
logger.info("suggest_feedback: %s suggestions for submission %d of exercise %d were requested",
"Graded" if is_graded else "Non-graded", submission.id, exercise.id)
return await generate_suggestions(exercise, submission, module_config.approach, module_config.debug)


Expand Down
2 changes: 1 addition & 1 deletion playground/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
FROM node:18.16.0-alpine
FROM node:18.17.0-alpine

LABEL org.opencontainers.image.source=https://github.com/ls1intum/Athena

Expand Down
12 changes: 6 additions & 6 deletions playground/data/example/exercise-1.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
"problem_statement": "-> file:problem-statement.md",
"grading_instructions": "-> file:grading-instructions.md",
"programming_language": "java",
"solution_repository_url": "{{exerciseDataUrl}}/solution.zip",
"template_repository_url": "{{exerciseDataUrl}}/template.zip",
"tests_repository_url": "{{exerciseDataUrl}}/tests.zip",
"solution_repository_uri": "{{exerciseDataUrl}}/solution.zip",
"template_repository_uri": "{{exerciseDataUrl}}/template.zip",
"tests_repository_uri": "{{exerciseDataUrl}}/tests.zip",
"meta": {},

"submissions": [
{
"id": 101,
"repository_url": "{{exerciseDataUrl}}/submissions/101.zip",
"repository_uri": "{{exerciseDataUrl}}/submissions/101.zip",
"meta": {},
"feedbacks": [
{
Expand All @@ -43,12 +43,12 @@
},
{
"id": 102,
"repository_url": "{{exerciseDataUrl}}/submissions/102.zip",
"repository_uri": "{{exerciseDataUrl}}/submissions/102.zip",
"meta": {}
},
{
"id": 103,
"repository_url": "{{exerciseDataUrl}}/submissions/103.zip",
"repository_uri": "{{exerciseDataUrl}}/submissions/103.zip",
"meta": {},
"feedbacks": [
{
Expand Down
Loading
Loading