Python ๐Ÿ App / Script

Django 4.1.7 Python 3.11 made-with-bash Ubuntu 22.10 Become a sponsor to JV-conseil Follow JVconseil on Twitter Follow JVconseil on Mastodon Follow JV conseil on GitHub

First launch a Ubuntu Terminal job connected to your UCloud folder.

Parameters

PythonAppJobParameters

๐Ÿ‘‰ See also PythonAppJobParameters.json template.

Usage

  1. Once the Ubuntu Terminal job has started, click on the Open interface blue button in the top right corner.

  2. Navigate to the ucloud folder cd /work/{your-working-folder}/ucloud.

  3. Then launch the script with . main.sh.

  4. Now your skeleton should look like this ๐Ÿ‘‡

     /work/{your-working-folder}/
     โ”œโ”€โ”€ data/
     โ”œโ”€โ”€ database/
     โ”œโ”€โ”€ env/
     โ”œโ”€โ”€ install/
     โ”œโ”€โ”€ jobs/
     โ””โ”€โ”€ ucloud/
         โ””โ”€โ”€ main.sh
     โ””โ”€โ”€ {your-gh-repo}/
         โ””โ”€โ”€ main.py
    
  5. In case you app process data, do not forget to load files in the data folder.

  6. Then follow instructions starting after Do you want to run your Python app question.

Warning

Your cloned GitHub repository must have a main.py file at its root level to be identified as a valid Python ๐Ÿ app.

Environment variables

Available environment variables created in UCloud job to interact within Django app.

import os

...

UCLD_PATH_TO_DATA = os.environ.get("UCLD_PATH_TO_DATA", "")

Sponsorship

If this project helps you, you can offer me a cup of coffee โ˜•๏ธ :-)

Become a sponsor to JV-conseil