This project was not compleated to its fullest form, feel free to use and finish as you wish.
-
Use UV to install dependencies:
uv sync -
Install pre-commit hooks:
uv run pre-commit install -
Install Ollama on your local machine from https://ollama.com/download and follow the instructions to set it up.
-
Run
uv run ollama startto start the Ollama server. -
Make sure you have access to the Rizzler server. See the section "How to Access the Server" below.
- To do all tasks (lint, format, mypy):
uv run tools.py l - To lint only:
uv run tools.py lint - To format only:
uv run tools.py format - To run mypy only:
uv run tools.py mypy
- To run a Python script:
uv run python <script_name>.py
- To run the web scraper: `uv run python -m data_collection.web_scraper
- Ensure you have set up the
.envfile in thedata_collectiondirectory with the necessary environment variables, as shown in.env-example. - NOTE: To run the scraper automatically, remove the
input()line in the scraper code.
- You need to have your public SSH key added to the server's
~/.ssh/authorized_keysfile. If you don't have a public/private key pair, you can generate one using the command:
ssh-keygenSelect the file path (path .ssh/idun will be used in this case) and set a passphrase if desired. This will create two files: the private key (e.g., idun) and the public key (e.g., idun.pub).
Then, ask Kristian to add your public key to the server.
-
To connect to the server, you need to create an SSH agent and add your private key to it. There are two ways to do this:
a) Use Remote-SSH in VSCode In your
.ssh/configfile, add the following configuration:Host rizzler HostName HOSTNAME User USERNAME IdentityFile ~/.ssh/idunReplace
HOSTNAMEandUSERNAMEwith the appropriate values (see Slack to get these). Then, in VSCode:- Press
F1, typeRemote-SSH: Connect to Host..., and selectrizzler. - You will be prompted to enter the passphrase for your private key if you set one.
b) Use a terminal that supports SSH agent forwarding You can do this with the following commands (in Git Bash or WSL):
eval "$(ssh-agent -s)" ssh-add ~/.ssh/idun ssh USERNAME@HOSTNAME
Replace
USERNAMEandHOSTNAMEwith the appropriate values (see Slack to get these). - Press
Note: You need to use NTNU VPN or be connected to NTNU network to access the server.