maitri01 commited on
Commit
89ce8a0
·
verified ·
1 Parent(s): d2ab5c4

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +265 -0
README.md CHANGED
@@ -0,0 +1,265 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Paris Hackathon: JURECA Environment Setup
2
+
3
+ **TLDR:** The **team lead** runs `hackathon_setup.sh` once. **Every other teammate** runs `teammate.sh` after the lead finishes. On future logins, activate the project rather than repeating initial setup.
4
+
5
+ This guide explains how to set up and use your team's shared environment on JURECA.
6
+
7
+ > **Project ID:** `training2666`. All commands below use this ID. If the organizers assign a different project, use that ID instead. The downloaded setup scripts must use the same ID.
8
+
9
+ ## Setup scripts
10
+
11
+ - [`hackathon_setup.sh`](https://huggingface.co/datasets/SprintML/hackathon/resolve/main/hackathon_setup.sh): run **once by the team lead**, before anyone else sets up.
12
+ - [`teammate.sh`](https://huggingface.co/datasets/SprintML/hackathon/resolve/main/teammate.sh): run **individually by every other team member**, after the team lead finishes.
13
+
14
+ **Setup order:** Team lead first → all other teammates afterward. Sign in to JURECA with your **own Jülich account**. Do not run both scripts from the same account.
15
+
16
+ ## 1. Team lead: initial setup
17
+
18
+ ### Download the scripts
19
+
20
+ ```bash
21
+ mkdir -p ~/hackathon-scripts
22
+ cd ~/hackathon-scripts
23
+
24
+ wget https://huggingface.co/datasets/SprintML/hackathon/resolve/main/hackathon_setup.sh -O hackathon_setup.sh
25
+ wget https://huggingface.co/datasets/SprintML/hackathon/resolve/main/teammate.sh -O teammate.sh
26
+ ```
27
+
28
+ You **do not** need to create your scratch folder manually. The setup script creates it.
29
+
30
+ ### Configure `hackathon_setup.sh`
31
+
32
+ Edit the configuration section, using actual Jülich usernames:
33
+
34
+ ```bash
35
+ TEAM_LEAD="<your-juelich-username>"
36
+ TEAMMATE_1="<teammate-1-username>"
37
+ TEAMMATE_2="<teammate-2-username>"
38
+ TEAMMATE_3="" # Leave unused entries empty
39
+ TEAM_FOLDER="<your-team-name>"
40
+ ```
41
+
42
+ - `TEAM_LEAD` is the team lead's Jülich username.
43
+ - `TEAMMATE_1` through `TEAMMATE_3` are the other members' usernames. Leave unused slots as `""`.
44
+ - `TEAM_FOLDER` is the shared folder name. Tell all teammates the exact value.
45
+ - At least one teammate must be configured.
46
+
47
+ ### Run the script
48
+
49
+ ```bash
50
+ source hackathon_setup.sh
51
+ ```
52
+
53
+ **Wait until the script finishes successfully before asking teammates to continue.** It activates the project, creates the scratch folder, configures access permissions, downloads datasets, creates task-specific `.venv` environments, and configures shared uv/Hugging Face cache locations.
54
+
55
+ The shared folder is:
56
+
57
+ ```text
58
+ /p/scratch/training2666/<team-lead-username>/<team-name>/
59
+ ```
60
+
61
+ ## 2. Other teammates: join the shared environment
62
+
63
+ **Only start after the team lead has completed Section 1.** Each teammate follows these steps from their own JURECA account.
64
+
65
+ ### Download `teammate.sh`
66
+
67
+ ```bash
68
+ mkdir -p ~/hackathon-scripts
69
+ cd ~/hackathon-scripts
70
+ wget https://huggingface.co/datasets/SprintML/hackathon/resolve/main/teammate.sh -O teammate.sh
71
+ ```
72
+
73
+ ### Configure `teammate.sh`
74
+
75
+ ```bash
76
+ TEAM_LEAD="<team-lead-username>"
77
+ TEAM_FOLDER="<team-name>"
78
+ ```
79
+
80
+ These values must match the team lead's configuration. `TEAM_LEAD` is **not** your own username unless you are the lead.
81
+
82
+ ### Run the script
83
+
84
+ ```bash
85
+ source teammate.sh
86
+ ```
87
+
88
+ This activates the project, configures shared cache paths, checks shared-folder access, installs `uv` if needed, and writes the shell configuration to `~/.bashrc`.
89
+
90
+ **Do not redownload datasets or recreate environments.** The team lead has already prepared the shared task folders.
91
+
92
+ ## 3. Work on a task
93
+
94
+ Change into a task directory, replacing the placeholders with the real names:
95
+
96
+ ```bash
97
+ cd /p/scratch/training2666/<team-lead>/<team-folder>/<dataset-name>
98
+ ```
99
+
100
+ Activate its Python environment and run your code:
101
+
102
+ ```bash
103
+ source .venv/bin/activate
104
+ python main.py
105
+ ```
106
+
107
+ If the task is configured as a uv project, you may instead use:
108
+
109
+ ```bash
110
+ uv run python main.py
111
+ ```
112
+
113
+ Replace `main.py` with the actual script name. Be aware that `uv run` may attempt to synchronize dependencies; coordinate changes to shared environments with teammates.
114
+
115
+ ### Expected folder layout
116
+
117
+ ```text
118
+ /p/scratch/training2666/
119
+ └── <team-lead-username>/
120
+ └── <team-folder>/
121
+ ├── unlearning/
122
+ │ ├── .venv/
123
+ │ ├── requirements.txt
124
+ │ └── output/
125
+ ├── model_equality/
126
+ │ ├── .venv/
127
+ │ ├── requirements.txt
128
+ │ └── output/
129
+ ├── Hackathon_Watermark_Localisation_Task/
130
+ │ ├── .venv/
131
+ │ ├── requirements.txt
132
+ │ └── output/
133
+ ├── .uv/
134
+ └── .cache/
135
+ ```
136
+
137
+ The specific files present may vary by task and dataset.
138
+
139
+ ## 4. Every new login/session
140
+
141
+ Activate the project:
142
+
143
+ ```bash
144
+ jutil env activate -p training2666
145
+ ```
146
+
147
+ If the cache variables are not available in the current shell:
148
+
149
+ ```bash
150
+ source ~/.bashrc
151
+ ```
152
+
153
+ Then enter your task directory and activate its `.venv` as needed. **Do not rerun the initial setup scripts at every login.**
154
+
155
+ ## 5. Submit GPU jobs
156
+
157
+ Create `main.sh` in the relevant task directory:
158
+
159
+ ```bash
160
+ #!/bin/bash
161
+ #SBATCH --account=training2666
162
+ #SBATCH --nodes=1
163
+ #SBATCH --ntasks-per-node=1
164
+ #SBATCH --gres=gpu:1
165
+ #SBATCH --reservation=cispa-hack
166
+ #SBATCH --cpus-per-task=8
167
+ #SBATCH --partition=dc-gpu
168
+ #SBATCH --output=output/%j.out
169
+ #SBATCH --error=output/%j.err
170
+
171
+ # Change to your task directory
172
+ cd /p/scratch/training2666/<team-lead>/<team-folder>/<dataset-name> || exit 1
173
+
174
+ # Activate the shared task environment
175
+ source .venv/bin/activate
176
+
177
+ # Run your program
178
+ srun python code.py
179
+
180
+ echo "done!"
181
+ ```
182
+
183
+ Replace placeholders and `code.py` with the correct values. **The account, reservation, partition, and GPU request must match the resources assigned by the organizers.**
184
+
185
+ Create `output/` **before** submitting the job, since Slurm needs the log directory to exist:
186
+
187
+ ```bash
188
+ mkdir -p output
189
+ sbatch main.sh
190
+ ```
191
+
192
+ Check queued/running jobs:
193
+
194
+ ```bash
195
+ squeue -u "$USER"
196
+ ```
197
+
198
+ Logs are written to `output/<job-id>.out` and `output/<job-id>.err`.
199
+
200
+ ## 6. Adding a teammate after initial setup
201
+
202
+ If someone joins later, **the team lead grants access**. Existing teammates do not need to rerun their scripts.
203
+
204
+ From the **team lead's account**, with the correct usernames:
205
+
206
+ ```bash
207
+ TEAM_LEAD="<team-lead-username>"
208
+ NEW_MEMBER="<new-member-username>"
209
+ TEAM_LEAD_DIR="/p/scratch/training2666/$TEAM_LEAD"
210
+
211
+ # Grant access to existing files and directories
212
+ setfacl -R -m "u:$NEW_MEMBER:rwx" "$TEAM_LEAD_DIR"
213
+
214
+ # Grant default access on new files and subdirectories
215
+ find "$TEAM_LEAD_DIR" -type d \
216
+ -exec setfacl -d -m "u:$NEW_MEMBER:rwx" {} +
217
+ ```
218
+
219
+ These commands provide broad read/write/execute access within the lead's scratch tree. Run them **only** when that level of access is intended. The new member then follows **Section 2** and runs `source teammate.sh` from their own account.
220
+
221
+ ## 7. Rules for shared work
222
+
223
+ - Do not delete shared folders or datasets.
224
+ - Do not modify ACL permissions unless you are the team lead managing team access.
225
+ - Do not recreate `.venv` environments without coordinating with the team.
226
+ - Avoid unnecessary or conflicting package changes in shared environments.
227
+ - Keep work within your assigned team folder and task directories.
228
+ - Put outputs and logs in the relevant task's `output/` folder.
229
+
230
+ ## 8. Troubleshooting
231
+
232
+ ### Cannot access the team folder
233
+
234
+ Confirm that `TEAM_LEAD` and `TEAM_FOLDER` are correct and that the lead completed setup. If you joined later, ask the lead to follow **Section 6**.
235
+
236
+ ### `uv: command not found`
237
+
238
+ ```bash
239
+ curl -LsSf https://astral.sh/uv/install.sh | sh
240
+ source ~/.local/bin/env
241
+ ```
242
+
243
+ ### Python environment is not active
244
+
245
+ Enter the task directory and run:
246
+
247
+ ```bash
248
+ source .venv/bin/activate
249
+ ```
250
+
251
+ If `.venv` does not exist, ask the team lead to check whether initial setup succeeded.
252
+
253
+ ### Project is not active
254
+
255
+ ```bash
256
+ jutil env activate -p training2666
257
+ ```
258
+
259
+ ### A dataset or environment is missing
260
+
261
+ Ask the team lead to inspect the initial setup output. Do not overwrite existing shared environments without coordinating with the team.
262
+
263
+ ---
264
+
265
+ **Quick recap:** The **team lead** runs `hackathon_setup.sh` once. **Every other teammate** runs `teammate.sh` after the lead finishes. On future logins, activate the project rather than repeating initial setup.