Skip to content

Old Dev Guide

Robb edited this page Nov 18, 2022 · 1 revision

OLD Development Guide

This document contains information a future development team may find helpful. It will go a bit in depth as to what the different technologies we used do and how they help. The document will also detail some of the errors our team has encountered and their solutions. At the end, there is a section to contact one of the previous team members for any questions the current dev has.

Software and Hardware Requirements

Computer

IDE (VSCode recommended)

Docker

Supabase

Installing the Required Software

Installing Docker

To see how to install Docker, checkout the User Guide located int README.md

Installing Supabase

First off make sure that you download docker on your local computer.

Go to the Monorepo folder of Supabase. Go to the directory of supabase/docker

enter the command : docker -compose up

Visit localhost:3000 to start up supabasestudio

Start the Docker Swarm Mode

Useful Links:

https://supabase.com/docs/guides/hosting/docker

https://supabase.com/docs/guides/hosting/overview#api-keys

https://login.docker.com/u/login  

The email used is:

[email protected]

The password is in our personal messages.Will not be posted for privacy reasons.

IDE Setup

Our team used Visual Studio Code as our IDE through out the entirety of the project. It is very nice since it keeps things simple and has tons of support for all the programming languages we ended up using. It also works nicely with Docker, with a neat plugin that can help with development. This extension is simply named Docker. Plus, in order to set up the repository in VSCode after cloning it onto your computer, all you have to do is open the folder in VSCode and then it is ready for development.

Software information

Docker

Docker is a neat software that allows the dev to put the components of a project in containers.These containers simulate a linux environment that allow the developer to not be limited by OS. It can also handle dependencies, without requiring the user to install any extra packages. Docker also allows for volumes, a shared file space which can also work with Kubernetes, a distributed system software that allows multiple devices to connect and use nodes on the device to run containers. This was the planned distributed system we were working on. The database uses postgresql.

Supabase

Supabase was a last minute decision to add due to the disappearance of our group member working on databases. For those who have used firebase, it is very similar in what it allows the dev team to do. The main reason we decided to use the database was because it combines authorization and a database for us to use. The database is not used due to lack of time, but it prepares future teams to use it. Check out the admin guide to see how you can get to the supabase storage hub to see accounts and database entries.

Updates

If any of the components require an update, then it should be rather easy to update the system it self. If the deployment system ends up not working due to an update or is not working correctly, then either one of the members can take a look at it or it could be replaced with some other form of the component needed. The components themselves should be relatively simple to change out, the main issue is docker. You will ahve to create a new Dockerfile for a newly implemented component and ensure that the container is created correctly.

Error Log

Here is where we will log errors that have come up throughout the development of GLADOS and list possible causes, any documentation that helped us understand what was going on, and possible fixes (if there was a fix found):

Error Cause Documentation (resources used to diagnose) Fixes
CORS-related for Frontend-to-backend connection CORS has an issue with sending messages between servers since we were running two separate servers on the same system for frontend and backend None Be sure the frontend and the api are running on the same port, otherwise CORS will be involved
Mapper failed with exception: [WinError 193] %1 is not a valid Win32 application for the Current Idea: need to be in some for of linux subsystem due to the use of python os https://linuxconfig.org/python-os-module
Error: EXDEV: cross-device link not permitted, GLADOS is trying to move information across data drives (i.e. from Local Drive to Hard Drive) https://stackoverflow.com/questions/43206198/what-does-the-exdev-cross-device-link-not-permitted-error-mean Have GLADOS and the experiment in the same storage device.
Mapper failed with error ./filename.py Generally, this error is because the experiment script is not able to be ran, either because it is not executable or the permission to execute on linux is not there. add #!/usr/bin/env python3 at the top of the .py scripts
Frontend container also prints the backend container’s start-up message There is an issue with docker or the container was built incorrectly Rebuild container, if the issue still occurs, factory reset docker
Error: python3\r could not be found Line endings need to be in LF not CRLF (vscode) https://medium.com/@csmunuku/windows-and-linux-eol-sequence-configure-vs-code-and-git-37be98ef71df Change the line endings to LF on the script itself.
Error: DBConnection.Error There is an issue with docker and it probably has a bad image. Uninstall docker completely. Remove the image. Rebuild and use the command docker compose -down to remove the old image.

Personal Contact

We hope to be able to remain in contact with the client in case of questions. One of the hopes for this project is to be able to build upon what we have made, whether that is to add more functionality or to completely refactor the system. The following list will show what team members to contact and how once the system is completed:

Elijah Williams ([email protected])