Skip to content

Commit ca0b3e0

Browse files
committed
fix: Fix the initial SQL data import for local docker-compose setup
1 parent fa502d5 commit ca0b3e0

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

docs/source/admin/system_architecture.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,3 @@ Different executors are available to manage this:
121121
# How To Scale
122122

123123
[//]: # (TODO: what is the minimal setup? what is the most sophisticated setup)
124-

examples/docker_compose/data_only.sql

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
INSERT INTO "user" VALUES('admin',NULL,'b3c349f83ef94143b644221523e04ca2','admin');
2-
INSERT INTO "user" VALUES('instructor',NULL,'3b80476d54ef49848f1dd00b436e9380','instructor');
3-
INSERT INTO "user" VALUES('student',NULL,'935f9b72143f40459ad7f5e32a94a4c1','student');
4-
INSERT INTO "user" VALUES('tutor',NULL,'77f888fee7f84bfbba6b226fce292115','tutor');
5-
INSERT INTO "user" VALUES('user1',NULL,'393ced73010a47a198edc44609c0d1b6','user1');
1+
INSERT INTO "user" VALUES('admin',NULL,'b3c349f83ef94143b644221523e04ca2','admin',1);
2+
INSERT INTO "user" VALUES('instructor',NULL,'3b80476d54ef49848f1dd00b436e9380','instructor',2);
3+
INSERT INTO "user" VALUES('student',NULL,'935f9b72143f40459ad7f5e32a94a4c1','student',3);
4+
INSERT INTO "user" VALUES('tutor',NULL,'77f888fee7f84bfbba6b226fce292115','tutor',4);
5+
INSERT INTO "user" VALUES('user1',NULL,'393ced73010a47a198edc44609c0d1b6','user1',5);
66
INSERT INTO lecture VALUES(1,'lect1','lect1','active','active','2025-04-15 11:58:36.963401','2025-04-15 11:58:36.963405');
77
INSERT INTO lecture VALUES(2,'lecture1','lecture1','active','active','2025-05-08 13:15:46.405114','2025-05-08 13:15:46.405118');
88
INSERT INTO assignment VALUES(1,'Assignment',1,1,'pushed','deleted','{"notebooks": {"sum_numbers": {"id": "sum_numbers", "name": "sum_numbers", "flagged": false, "kernelspec": "{\"display_name\": \"Python 3 (ipykernel)\", \"language\": \"python\", \"name\": \"python3\"}", "grade_cells_dict": {"cell-1e1d884e2e83e97f": {"max_score": 1.0, "cell_type": "code", "notebook_id": null, "name": "cell-1e1d884e2e83e97f", "id": null, "grade_id": null, "comment_id": null, "_type": "GradeCell"}}, "solution_cells_dict": {"cell-ec1c0a6598d73f81": {"notebook_id": null, "name": "cell-ec1c0a6598d73f81", "id": null, "grade_id": null, "comment_id": null, "_type": "SolutionCell"}}, "task_cells_dict": {}, "source_cells_dict": {"cell-ec1c0a6598d73f81": {"notebook_id": null, "name": "cell-ec1c0a6598d73f81", "id": null, "cell_type": "code", "locked": false, "source": "\ndef sum_numbers(num):\n # YOUR CODE HERE\n raise NotImplementedError()\n", "checksum": "3abfdaf7b8b9569fc58d25d6471d4cbd", "_type": "SourceCell"}, "cell-1e1d884e2e83e97f": {"notebook_id": null, "name": "cell-1e1d884e2e83e97f", "id": null, "cell_type": "code", "locked": true, "source": "assert sum_numbers(1) == 1\nassert sum_numbers(2) == 3\nassert sum_numbers(5) == 15", "checksum": "6453ffdd62ea1a1eabcf95616174dd88", "_type": "SourceCell"}}, "grades_dict": {}, "comments_dict": {}, "_type": "Notebook"}}, "extra_files": ["title.md"], "_type": "GradeBookModel", "schema_version": "1"}','2025-04-15 13:09:04.651575','2025-06-03 12:20:17.821961','{"deadline": "2025-04-17T12:10:18.317000+00:00", "max_submissions": null, "allowed_files": [], "late_submission": null, "autograde_type": "auto"}');
@@ -12,19 +12,20 @@ INSERT INTO assignment VALUES(4,'Assignment 4',1,0,'created','deleted',NULL,'202
1212
INSERT INTO assignment VALUES(5,'Currency Conversion',1,5,'released','active','{"notebooks": {"convert_dollar": {"id": "convert_dollar", "name": "convert_dollar", "flagged": false, "kernelspec": "{\"display_name\": \"Python 3 (ipykernel)\", \"language\": \"python\", \"name\": \"python3\"}", "grade_cells_dict": {"cell-ac6f865522fb45c0": {"max_score": 1.0, "cell_type": "code", "notebook_id": null, "name": "cell-ac6f865522fb45c0", "id": null, "grade_id": null, "comment_id": null, "_type": "GradeCell"}, "cell-97b08476829c31b2": {"max_score": 4.0, "cell_type": "code", "notebook_id": null, "name": "cell-97b08476829c31b2", "id": null, "grade_id": null, "comment_id": null, "_type": "GradeCell"}}, "solution_cells_dict": {"cell-87e7eb777dedef14": {"notebook_id": null, "name": "cell-87e7eb777dedef14", "id": null, "grade_id": null, "comment_id": null, "_type": "SolutionCell"}}, "task_cells_dict": {}, "source_cells_dict": {"cell-87e7eb777dedef14": {"notebook_id": null, "name": "cell-87e7eb777dedef14", "id": null, "cell_type": "code", "locked": false, "source": "def convert_dollar(dollar):\n # YOUR CODE HERE\n raise NotImplementedError()", "checksum": "5ed5fb06cd04ff189fa63b6345d4f246", "_type": "SourceCell"}, "cell-ac6f865522fb45c0": {"notebook_id": null, "name": "cell-ac6f865522fb45c0", "id": null, "cell_type": "code", "locked": true, "source": "eur, gbp = convert_dollar(5)\nassert eur == 4.6548194\nassert gbp == 4.0059821499999995", "checksum": "721905ff987abff4d78f1fa62f764059", "_type": "SourceCell"}, "cell-97b08476829c31b2": {"notebook_id": null, "name": "cell-97b08476829c31b2", "id": null, "cell_type": "code", "locked": true, "source": "assert convert_dollar(20) == (18.6192776, 16.023928599999998)\n### BEGIN HIDDEN TESTS\nassert convert_dollar(1923810) == (1790997.6219827998, 1541349.7039983)\nassert convert_dollar(0) == (0.0, 0.0)\nassert convert_dollar(999) == (930.03291612, 800.39523357)\n### END HIDDEN TESTS", "checksum": "a10b1b507cc9ecafa74b3cbfdf59bd3a", "_type": "SourceCell"}}, "grades_dict": {}, "comments_dict": {}, "_type": "Notebook"}}, "extra_files": ["Currency Conversion.md"], "_type": "GradeBookModel", "schema_version": "1"}','2025-06-03 12:23:27.310610','2025-06-04 10:12:32.878997','{"deadline": "2025-06-03T12:23:04+00:00", "max_submissions": null, "allowed_files": [], "late_submission": [], "autograde_type": "auto"}');
1313
INSERT INTO assignment VALUES(6,'Introduction to numpy',1,2,'released','active','{"notebooks": {"introduction_to_numpy": {"id": "introduction_to_numpy", "name": "introduction_to_numpy", "flagged": false, "kernelspec": "{\"display_name\": \"Python 3 (ipykernel)\", \"language\": \"python\", \"name\": \"python3\"}", "grade_cells_dict": {"cell-35637aad1a42d8a0": {"max_score": 2.0, "cell_type": "code", "notebook_id": null, "name": "cell-35637aad1a42d8a0", "id": null, "grade_id": null, "comment_id": null, "_type": "GradeCell"}}, "solution_cells_dict": {"cell-25eebd639059cd56": {"notebook_id": null, "name": "cell-25eebd639059cd56", "id": null, "grade_id": null, "comment_id": null, "_type": "SolutionCell"}, "cell-180fb26ddc489bfc": {"notebook_id": null, "name": "cell-180fb26ddc489bfc", "id": null, "grade_id": null, "comment_id": null, "_type": "SolutionCell"}}, "task_cells_dict": {}, "source_cells_dict": {"cell-25eebd639059cd56": {"notebook_id": null, "name": "cell-25eebd639059cd56", "id": null, "cell_type": "code", "locked": false, "source": "import numpy as np\n\ndef create_array_with_zeros(length):\n # YOUR CODE HERE\n raise NotImplementedError()", "checksum": "d324a6aeb5afd8f8f93166e12701880f", "_type": "SourceCell"}, "cell-180fb26ddc489bfc": {"notebook_id": null, "name": "cell-180fb26ddc489bfc", "id": null, "cell_type": "code", "locked": false, "source": "import numpy as np\n\ndef create_array_with_value(length, value):\n # YOUR CODE HERE\n raise NotImplementedError()\n ", "checksum": "d93f5938b7a2cd8dd16f41cd81170f0f", "_type": "SourceCell"}, "cell-35637aad1a42d8a0": {"notebook_id": null, "name": "cell-35637aad1a42d8a0", "id": null, "cell_type": "code", "locked": true, "source": "import numpy as np\n\nassert np.array_equal(create_array_with_zeros(5), np.array([0, 0, 0, 0, 0]))\nassert np.array_equal(create_array_with_value(5, 2), np.array([2, 2, 2, 2, 2]))\n\n### BEGIN HIDDEN TESTS\nassert np.array_equal(create_array_with_zeros(10), np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0]))\nassert np.array_equal(create_array_with_value(7, 3), np.array([3, 3, 3, 3, 3, 3, 3]))\n### END HIDDEN TESTS", "checksum": "d29660fbfeb3ef146b119b849cd90791", "_type": "SourceCell"}}, "grades_dict": {}, "comments_dict": {}, "_type": "Notebook"}}, "extra_files": ["Introduction to numpy.md"], "_type": "GradeBookModel", "schema_version": "1"}','2025-06-04 09:13:01.470737','2025-06-04 09:42:48.682905','{"deadline": null, "max_submissions": null, "allowed_files": [], "late_submission": [], "autograde_type": "auto"}');
1414
INSERT INTO assignment VALUES(7,'Repeated List',1,4,'pushed','active','{"notebooks": {"repeat_list": {"id": "repeat_list", "name": "repeat_list", "flagged": false, "kernelspec": "{\"display_name\": \"Python 3 (ipykernel)\", \"language\": \"python\", \"name\": \"python3\"}", "grade_cells_dict": {"cell-c163851be78a4581": {"max_score": 4.0, "cell_type": "code", "notebook_id": null, "name": "cell-c163851be78a4581", "id": null, "grade_id": null, "comment_id": null, "_type": "GradeCell"}}, "solution_cells_dict": {"cell-4706c7c4d2dc5c83": {"notebook_id": null, "name": "cell-4706c7c4d2dc5c83", "id": null, "grade_id": null, "comment_id": null, "_type": "SolutionCell"}}, "task_cells_dict": {}, "source_cells_dict": {"cell-4706c7c4d2dc5c83": {"notebook_id": null, "name": "cell-4706c7c4d2dc5c83", "id": null, "cell_type": "code", "locked": false, "source": "def repeat_list(item, times):\n # YOUR CODE HERE\n raise NotImplementedError()\n", "checksum": "c86c729bb6799cf30e47aaeb05f3a19d", "_type": "SourceCell"}, "cell-c163851be78a4581": {"notebook_id": null, "name": "cell-c163851be78a4581", "id": null, "cell_type": "code", "locked": true, "source": "assert repeat_list(''x'', 5) == [''x'', ''x'', ''x'', ''x'', ''x'']\nassert repeat_list(0, 3) == [0, 0, 0]\n### BEGIN HIDDEN TESTS\nassert repeat_list(True, 2) == [True, True]\nassert repeat_list(''hi'', 0) == []\n### END HIDDEN TESTS", "checksum": "de72b3aa803cdc9c9e7b2cf5dc425176", "_type": "SourceCell"}}, "grades_dict": {}, "comments_dict": {}, "_type": "Notebook"}}, "extra_files": [], "_type": "GradeBookModel", "schema_version": "1"}','2025-06-04 09:45:14.998759','2025-06-04 09:54:32.374718','{"deadline": null, "max_submissions": null, "allowed_files": [], "late_submission": null, "autograde_type": "auto"}');
15-
INSERT INTO takepart VALUES('admin',1,'instructor');
16-
INSERT INTO takepart VALUES('instructor',1,'instructor');
17-
INSERT INTO takepart VALUES('student',1,'student');
18-
INSERT INTO takepart VALUES('tutor',1,'tutor');
19-
INSERT INTO submission VALUES(1,'2025-04-16 08:32:44.856742','grading_failed','not_graded',NULL,NULL,1,'admin','287b17b30bb46764eb106b2194e0fae8fc72bb17','2025-04-16 08:32:44.926463',NULL,1,'not_generated','active');
20-
INSERT INTO submission VALUES(2,'2025-04-16 08:46:07.458149','grading_failed','not_graded',NULL,NULL,1,'admin','9e519305e1f009ad31c3ccd46fe326b3c7993b40','2025-04-16 08:46:07.530051',NULL,1,'not_generated','active');
21-
INSERT INTO submission VALUES(3,'2025-04-16 09:16:43.602760','automatically_graded','not_graded',NULL,0,1,'admin','c5d9c676595ac13ad2abc8ea93ac4ecfec72b47c','2025-04-16 09:16:45.704466',0,1,'not_generated','active');
22-
INSERT INTO submission VALUES(4,'2025-04-16 09:30:40.750970','automatically_graded','manually_graded',true,1.125,2,'admin','7412d697155511de7c88d7990ad3616cc3437f79','2025-04-16 10:16:11.630340',1.25,0.900000000000000022,'generated','active');
23-
INSERT INTO submission VALUES(5,'2025-04-16 09:47:23.946933','automatically_graded','not_graded',NULL,0,3,'admin','79ca26a5f2b560432454c05a0c7c2fb7846fdb91','2025-04-16 09:47:25.484453',0,1,'not_generated','active');
24-
INSERT INTO submission VALUES(6,'2025-04-16 09:48:33.323631','automatically_graded','manually_graded',true,0,3,'admin','6611b94515027e5e3a3818ff1a18a1e43b9e724b','2025-04-16 09:53:18.163605',0,1,'not_generated','active');
25-
INSERT INTO submission VALUES(7,'2025-05-22 09:49:01.106028','not_graded','not_graded',true,NULL,3,'student','0000000000000000000000000000000000000000','2025-05-22 09:49:01.244816',NULL,0,'not_generated','active');
26-
INSERT INTO submission VALUES(8,'2025-06-04 10:01:20.607586','automatically_graded','not_graded',NULL,0,5,'admin','b03cd5004521bdbaf362267a5f9acd12ff699cb2','2025-06-04 10:09:11.726552',5,0,'not_generated','active');
27-
INSERT INTO submission VALUES(9,'2025-06-04 10:11:30.572845','automatically_graded','not_graded',NULL,5,5,'student','97ca42691d63d727826d966a7a8d574e25abab0b','2025-06-04 10:11:31.784424',5,1,'not_generated','active');
15+
INSERT INTO takepart VALUES(1,'instructor',1);
16+
INSERT INTO takepart VALUES(1,'instructor',2);
17+
INSERT INTO takepart VALUES(1,'student',3);
18+
INSERT INTO takepart VALUES(1,'tutor',4);
19+
-- id | date | auto_status | manual_status |edited|score|assignid | commit_hash | updated_at |grading_score| score_scaling | feedback_status | deleted | user_id
20+
INSERT INTO submission VALUES(1,'2025-04-16 08:32:44.856742','GRADING_FAILED','NOT_GRADED', NULL,NULL, 1,'287b17b30bb46764eb106b2194e0fae8fc72bb17','2025-04-16 08:32:44.926463', NULL, 1, 'NOT_GENERATED','active',1);
21+
INSERT INTO submission VALUES(2,'2025-04-16 08:46:07.458149','GRADING_FAILED','NOT_GRADED', NULL,NULL, 1,'9e519305e1f009ad31c3ccd46fe326b3c7993b40','2025-04-16 08:46:07.530051', NULL, 1, 'NOT_GENERATED','active',1);
22+
INSERT INTO submission VALUES(3,'2025-04-16 09:16:43.602760','AUTOMATICALLY_GRADED','NOT_GRADED', NULL,0, 1,'c5d9c676595ac13ad2abc8ea93ac4ecfec72b47c','2025-04-16 09:16:45.704466', 0, 1, 'NOT_GENERATED','active',1);
23+
INSERT INTO submission VALUES(4,'2025-04-16 09:30:40.750970','AUTOMATICALLY_GRADED','MANUALLY_GRADED',true,1.125,2,'7412d697155511de7c88d7990ad3616cc3437f79','2025-04-16 10:16:11.630340', 1.25, 0.900000000000000022,'GENERATED','active',1);
24+
INSERT INTO submission VALUES(5,'2025-04-16 09:47:23.946933','AUTOMATICALLY_GRADED','NOT_GRADED', NULL,0, 3,'79ca26a5f2b560432454c05a0c7c2fb7846fdb91','2025-04-16 09:47:25.484453', 0, 1, 'NOT_GENERATED','active',1);
25+
INSERT INTO submission VALUES(6,'2025-04-16 09:48:33.323631','AUTOMATICALLY_GRADED','MANUALLY_GRADED',true,0, 3,'6611b94515027e5e3a3818ff1a18a1e43b9e724b','2025-04-16 09:53:18.163605', 0, 1, 'NOT_GENERATED','active',1);
26+
INSERT INTO submission VALUES(7,'2025-05-22 09:49:01.106028','NOT_GRADED','NOT_GRADED', true,NULL, 3,'0000000000000000000000000000000000000000','2025-05-22 09:49:01.244816', NULL, 0, 'NOT_GENERATED','active',3);
27+
INSERT INTO submission VALUES(8,'2025-06-04 10:01:20.607586','AUTOMATICALLY_GRADED','NOT_GRADED', NULL,0, 5,'b03cd5004521bdbaf362267a5f9acd12ff699cb2','2025-06-04 10:09:11.726552', 5, 0, 'NOT_GENERATED','active',1);
28+
INSERT INTO submission VALUES(9,'2025-06-04 10:11:30.572845','AUTOMATICALLY_GRADED','NOT_GRADED', NULL,5, 5,'97ca42691d63d727826d966a7a8d574e25abab0b','2025-06-04 10:11:31.784424', 5, 1, 'NOT_GENERATED','active',3);
2829
INSERT INTO submission_logs VALUES(1,replace('[2025-04-16 10:32:44] [WARNING] No notebooks were matched by ''/home/nadja/work/service/service_dir/convert_in/submission_1/*.ipynb''\n[2025-04-16 10:32:44] [INFO] Reading 1335 bytes from /home/nadja/work/service/service_dir/convert_out/submission_1/gradebook.json\n[2025-04-16 10:32:44] [INFO] Found additional file patterns: []\n[2025-04-16 10:32:44] [INFO] Copying files from /home/nadja/work/service/service_dir/convert_in/submission_1 to /home/nadja/work/service/service_dir/convert_out/submission_1 that match allowed patterns and don''t match ignored patterns.\n[2025-04-16 10:32:44] [INFO] Copied the following files: []\n','\n',E'\n'));
2930
INSERT INTO submission_logs VALUES(2,replace('[2025-04-16 10:46:07] [INFO] Reading 1345 bytes from /home/nadja/work/service/service_dir/convert_out/submission_2/gradebook.json\n[2025-04-16 10:46:07] [INFO] Found additional file patterns: []\n[2025-04-16 10:46:07] [INFO] Copying files from /home/nadja/work/service/service_dir/convert_in/submission_2 to /home/nadja/work/service/service_dir/convert_out/submission_2 that match allowed patterns and don''t match ignored patterns.\n[2025-04-16 10:46:07] [INFO] Copied the following files: []\n','\n',E'\n'));
3031
INSERT INTO submission_logs VALUES(3,replace('[2025-04-16 11:16:43] [INFO] Reading 1345 bytes from /home/nadja/work/service/service_dir/convert_out/submission_3/gradebook.json\n[2025-04-16 11:16:43] [INFO] Found additional file patterns: []\n[2025-04-16 11:16:43] [INFO] Copying files from /home/nadja/work/service/service_dir/convert_in/submission_3 to /home/nadja/work/service/service_dir/convert_out/submission_3 that match allowed patterns and don''t match ignored patterns.\n[2025-04-16 11:16:43] [INFO] Copied the following files: [''title.md'']\n[2025-04-16 11:16:43] [INFO] Writing 1345 bytes to /home/nadja/work/service/service_dir/convert_out/submission_3/gradebook.json\n[2025-04-16 11:16:43] [INFO] Reading 1345 bytes from /home/nadja/work/service/service_dir/convert_out/submission_3/gradebook.json\n[2025-04-16 11:16:43] [INFO] Sanitizing /home/nadja/work/service/service_dir/convert_in/submission_3/sum_numbers.ipynb\n[2025-04-16 11:16:43] [INFO] Converting notebook /home/nadja/work/service/service_dir/convert_in/submission_3/sum_numbers.ipynb\n[2025-04-16 11:16:43] [INFO] Reading 1345 bytes from /home/nadja/work/service/service_dir/convert_out/submission_3/gradebook.json\n[2025-04-16 11:16:43] [INFO] Overwriting submitted notebook kernelspec: {''display_name'': ''Python 3 (ipykernel)'', ''language'': ''python'', ''name'': ''python3''}\n[2025-04-16 11:16:43] [INFO] Reading 1345 bytes from /home/nadja/work/service/service_dir/convert_out/submission_3/gradebook.json\n[2025-04-16 11:16:43] [INFO] Writing 1625 bytes to /home/nadja/work/service/service_dir/convert_out/submission_3/sum_numbers.ipynb\n[2025-04-16 11:16:43] [INFO] Autograding /home/nadja/work/service/service_dir/convert_out/submission_3/sum_numbers.ipynb\n[2025-04-16 11:16:43] [INFO] Converting notebook /home/nadja/work/service/service_dir/convert_out/submission_3/sum_numbers.ipynb\n[2025-04-16 11:16:45] [INFO] Reading 1345 bytes from /home/nadja/work/service/service_dir/convert_out/submission_3/gradebook.json\n[2025-04-16 11:16:45] [INFO] Writing 1907 bytes to /home/nadja/work/service/service_dir/convert_out/submission_3/gradebook.json\n[2025-04-16 11:16:45] [INFO] Writing 3814 bytes to /home/nadja/work/service/service_dir/convert_out/submission_3/sum_numbers.ipynb\n[2025-04-16 11:16:45] [INFO] Setting destination file permissions to 664\n[2025-04-16 11:16:45] [INFO] Reading 1907 bytes from /home/nadja/work/service/service_dir/convert_out/submission_3/gradebook.json\n[2025-04-16 11:16:45] [INFO] Found additional file patterns: []\n[2025-04-16 11:16:45] [INFO] Copying files from /home/nadja/work/service/service_dir/convert_in/submission_3 to /home/nadja/work/service/service_dir/convert_out/submission_3 that match allowed patterns and don''t match ignored patterns.\n[2025-04-16 11:16:45] [INFO] Copied the following files: [''title.md'']\n[2025-04-16 11:16:45] [INFO] Writing 1907 bytes to /home/nadja/work/service/service_dir/convert_out/submission_3/gradebook.json\n','\n',E'\n'));

examples/docker_compose/init-db.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

22
/venv/bin/grader-service-migrate -f /app/grader_service_config.py
33

4-
psql -h postgres -U postgres -d grader -f /app/data_only.sql
4+
psql -h postgres -U postgres -d grader -f /app/data_only.sql

0 commit comments

Comments
 (0)