This is the main code base for the Lab infrastructure which keeps ICRS running. ICRS is the Imperial College Robotics Society, helping about 500 members to make cool robotics projects!
- Live-streaming Bambu Lab printer statuses to Discord, and live-streaming
- Only allowing printing once a card has been scanned
- A hand-held card scanner to see if members are inducted
- A Discord Quiz platform for inductions
- Published at ISAM 2024
- 🤖 Lab Manager Discord Bot: Uses Discord as a UI for members and staff
- 🗃️ ICRS LAB Back end: Handles Communication between Discord, the Database, notion and APIs
- ⛃ ICRS Database: Database for everything
- 💳 ICRS Card Scanner: Can scan HF Cards and display a member's status
git clone [email protected]:ICRS/icrs_lab.git
For the first time: git submodule update --recursive --remote
Every update after that: git submodule update --recursive
Run python project_setup.py
and follow the instructions.
- Postgres
- Python
- Autopep8
- Pylance
- Docker
https://discord.com/developers/applications/
Add Bot to the ICRS test server (or your own) with administrator
permissions, and bot
&application
scopes, and all the intents
Then get Discord token (eg xxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxx.x-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
)
Install the following
- Docker
- Docker-compose
- Python 3.10+
- Postman (non-essential but recommended)
copy paste the following files and remove the "template" part of teh file name:
.env_template
->.env
discord_settings_template.json
->discord_settings.json
printer_settings_template.json
->printer_settings.json
Enter your discord token into a .env
replacing <YOUR_DISCORD_TOKEN>
Replace YOUR_DISCORD_SERVER_ID
with the server ID
Replace YOUR_ADMIN_ID
with your Discord user ID
docker compose up --build --watch
This should take about 1 minute for the first build and about 30 seconds for subsequent builds
ctrl + c
to stop the server
Then go to Discord and use the bot (make sure to reboot Discord on the first launch or after adding new commands)
Wait about 20 seconds between changes and testing for the bot to rebuild
http://localhost:8000/docs
for the FastAPI docs
use the VS code extensions to connect to the DB
with the settings in example_postgress.ini
and the IP 172.18.0.2:8000/
TODO: Do this section properly
Set up SSH ssh into server
cd code;
cd <REPO>;
git pull;
docker-compose up --build -d
Delete Pod on Kubernetes
For any questions please reach out to us at [email protected]