Tools for labs

Author

Ludovic Deneuville

Instructions

  • In the lab instructions, you have to replace <...> with an appropriate value.
Example
  • git commit -m "<explicit message>"
  • ➡️ git commit -m "fix: log in error"
  • Don’t skip a step that didn’t work, telling yourself that it doesn’t matter
    • This may cause problems later on

Datalabs

Important

You require resources to start your services, the datalabs are available for that purpose.

Once you have completed your tasks, make sure to free up these resources by deleting or pausing your services.

Custom service

If the catalogue services do not fully meet your needs, you can use customised services.

Note

URLs to launch custom VSCode-python services for:

Explanations

In these labs, we will need a customised VSCode service, different from the one offered in the catalogue:

  • by installing additional Python packages
  • by modifying certain extensions
    • using Ruff instead of Flake8 to format the code
  • by opening a specific port to deploy an API
Important

Opening the port to deploy the API must be done before launching the service.

After that, it is too late, and you will have to delete it and start over.

Ways to customise a service

  • Launch the catalogue service, then modify it by executing commands manually
  • Use an initialisation script that will run immediately after the catalogue service is launched
    • In the form before Launch: Initialization scripts
    • Example
  • Create and use a Docker image based on the original service
    • In the form before Launch: Service > Use a custom image

VSCode

Open Folder

File > Open Folder > /home/onyxia/work/<repo_name> > OK

Caution

Open Folder allows you to determine the root folder you are currently in.

To find out the current folder, look at the top left of the explorer for the parent folder.

This choice is very important because imports between Python modules use relative paths.

Git

Git tuto

Command Description
git clone https://....git Creates a copy of a remote repository in your local directory.
git add . Stages all changes for the next commit.
git commit -m "<explicit message>" Commits the staged changes to the local repository.
git push Uploads local changes to a remote repository.
git pull Merge changes from a remote to the local repository.
git switch <branch> Switches to the specified branch.

VM ENSAI

In previous years, tutorials and projects were carried out on ENSAI VMs. You can therefore use it as a backup.

The necessary tools are still available there for development:

  • Visual Studio Code
  • Python 3.10
  • Git
  • a PostgreSQL database
Important

All students have access to a database that can only be accessed from ENSAI VMs. For more information, click here

Personal computer

Warning

The biggest challenge if you want to work on your personal machine will be to setup a local PostgreSQL database.

That is why it is strongly advised not to work on your personal computer if you do not feel capable of carrying out these installations completely on your own.

This could take a lot of time and energy, and it is not the role of project managers to help you with these installations.

To complete the practical work and project on your personal computer, you must install:

  • Visual Studio Code or another IDE
  • Python
  • Git
  • PostgreSQL