Skip to main content

Add your own service on EDITO

Learn how to deploy your own application as a service on EDITO using pre-configured tools: static website, Shiny-app and add-your-service.

Updated over 2 weeks ago

Context


On EDITO, a service is an interactive application (serving API and/or a graphical web interface). It can be a data science tool or an end-user application (decision making applications, What-If applications or focus applications) dedicated to anyone or to a specific community of users.

In this article you will learn about the many ways you can deploy a service on the EDITO platform.

⚠️ WARNING ⚠️

Even though the service remains available with a permanent ingress, it may be deleted during platform maintenance. We strongly recommend saving the service configuration at the time of creation using the “Save” button to facilitate restart in case of an outage, and saving your code to a remote repository or in your “My Files” space. The service content will use resources from your temporary storage, not the permanent storage corresponding to the content in “My Files”.

Deploy a static website


You can easily deploy a static website on your space, accessible at an address such as: https://my-custom-name.lab.dive.edito.eu

The Static-pages service allows you to host and automatically serve the files of a static website from a public or private Git repository. This service is ideal for hosting a documentation, a data visualization or any other static web content directly from your source code.

Push the required files (index.html, assets/, etc.) to a remote repository. Then, start a Static-pages service from your space on the Datalab. You will be prompted to fill in a configuration form.

💡 EDITO Pro Tip : you can save your configuration by giving it a name (1) and clicking on save (7)! Do not forget to save just before launching (8) to have the full configuration saved.

Resources (2)

Here you can define the resources on which the service will run. Your service will have at least the requested resources (1) and never more than its limits (2).

Git (3)

You now need to provide Git repository access information in the Git section (3). There are two possibilities:

  1. If your repository is public:

    1. Enable Add git config inside your environment in the Git section (3) of the form to enable internal Git configuration

    2. Provide the repository URL in Repository

  2. If your repository is private, you can add your authentication information in the corresponding fields:

    1. Name

    2. Email

    3. Token (personal access token)

By default, the service will pull files from the main branch of your repository. If you need to target a specific branch, specify its name in the Branch field.

Static website files (4)

The service automatically reads the content of your index.html file:

  • If your index.html file is located in a subdirectory of the repository, specify the path in Source

  • If the files are located at the root of the repository, you can leave this field empty

Ingress Details (5)

You can customize the service URL, for example: https://my-custom-name.lab.dive.edito.eu

Building your static website (6)

In case your source files need to be built, you need to specify the path to the build script. This script shall install the tools needed to build the source files. Be aware that the script will run at every refresh of the Git files, hence it shall avoid re-installing dependencies every time.

This is an example of such a build script for a yarn-based website:

#!/usr/bin/bash

SCRIPT_DIR=$( dirname $(readlink -f "${BASH_SOURCE[0]}") )
pushd $SCRIPT_DIR > /dev/null

which node
returnValue=$?
if [ $returnValue -ne 0 ]; then
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash
\. "$HOME/.nvm/nvm.sh"
nvm install 22
echo "Node version: `node -v`"
echo "Node current version: `nvm current`"
echo "NPM version: `npm -v`"
echo "Install Yarn..."
npm install --global yarn
echo "Yarn installed"
fi

yarn --cwd /app/repository install
yarn --cwd /app/repository build

popd > /dev/null

The /app/repository is the home of your cloned repository in the running container. You can use the website source path variable specify at the service launch time if wanted, as follows app/repository/$WEBSITE_SOURCE_PATH.

Updating your website

The service automatically checks the repository for updates every 5 minutes. To trigger an immediate refresh, call the public update endpoint /update:

This will instantly fetch the latest changes from your Git repository.

Once everything is ready, don't forget to save your configuration by changing the friendly name (1) and clicking save (7).

You can then launch (8) the tool, and your process will be visible in the Service Playground catalogue within 5 minutes.

Deploy from Shiny App Service


You can easily deploy your Shiny application using Shiny App service. This service retrieves your Python or R application directly from a public or private Git repository and deploys it automatically.

💡 EDITO Pro Tip : you can save your configuration by giving it a name (1) and clicking on save (6)! Do not forget to save just before launching (7) to have the full configuration saved.

Using Shiny App with a Python project

To use the Shiny App service with a Python project, your application files must be stored in a remote Git repository. All required dependencies should be listed in a requirements.txt file.

  1. Git configuration (2)

    1. Enable the Git section

    2. Provide your repository URL in the Repository field

    3. If your repository is private, fill in the authentication fields (Name, Email, Token) so the service can access your code

  2. Shiny configuration (3)

    1. Select the language: Python

    2. Provide the path to your main Python script within the repository (e.g. myproject/script.py, or script.py if the file is located at the repository root)

    3. Optionally, provide the path to your dependency file (e.g. myproject/requirements.txt)

  3. Optional settings

    1. Customize your application exposure in the Ingress Details section (4)

    2. Adjust the allocated resources (CPU, memory) in the Resources section (5)

Using Shiny App with an R project

To use the Shiny App service with an R project, your application files must also be stored in a remote Git repository. The required R packages can be listed in a requirements.txt file.

  1. Git configuration (2)

    1. Enable the Git section

    2. Provide your repository URL in the Repository field.

    3. If your repository is private, fill in the authentication fields (Name, Email, Token) so the service can access your code

  2. Shiny configuration (3)

    1. Select the language: R

    2. Provide the path to your main R script within the repository (e.g. myproject/app.R, or app.R if the file is located at the repository root).

    3. Optionally, provide the path to your dependency file (e.g. myproject/requirements.txt)

    4. The optionally InitScriptPath field allows you to specify the path to a Bash script. This script can be used to install system-level dependencies required by some R packages that are not available in the default Docker image used by the service

  3. Optional settings

    1. Customize your application exposure in the Ingress Details section (4)

    2. Adjust the allocated resources (CPU, memory) in the Resources section (5)

Deploy from a Docker image or a Dockerfile using add-your-service


⚠️ The tool add-your-service is an early feature. Please, contact the user support using the widget available at the bottom right of the page to be authorized to access the contribution tools.

💡 EDITO Pro Tip: Docker is a platform that allows you to build, package, and run applications inside lightweight and portable containers. These containers ensure that your application always runs the same way, regardless of the environment. For more information, you can refer to the official Docker documentation.

Helm is a package manager for Kubernetes that helps you define, install, and manage applications using reusable templates called charts. For more information, you can refer to the official Helm documentation.

Introduction

You can easily deploy a service in your workspace, accessible at an address like https://my-custom-name.lab.dive.edito.eu, from either a Docker image or a Dockerfile hosted in a remote repository.

To do so, use the add-your-service tool available in the Contribution tab of the Datalab Process Catalogue. It retrieves an existing Docker image or a Dockerfile from a remote Git repository and creates a service that will then be accessible from the Service Playground catalogue.

💡 EDITO Pro Tips :

  • Once the add-your-service tool is complete, your service will be accessible in the Process Playground catalogue within 5 minutes.

  • You can also save your configuration by giving it a name (1) and clicking on save (7)! Do not forget to save just before launching (8) to have the full configuration saved.

Configuration (2): where do you deploy from?

The Configuration section (2) allows you to initiate where you will deploy your process. There are two options available to you: from an existing Docker image or from a Docker file.

Deploy from an Existing Docker Image

If you already built and pushed a Docker image to a registry, you’re in the right place.

Once you start the add-your-service tool, fill in the Configuration form fields:

  1. Enable the Container image is already built option by setting it to true

  2. Specify your image URL in the Image tag field.

    Example: if your image is on Docker Hub, the URL will look like docker.io/myaccount/my-image-name:tag

  3. Finally, indicate the port used by your service under Network / Port.

With this information, add-your-service will create a Helm Chart based on the image provided.

Deploy from a Dockerfile

If your project is hosted in a remote Git repository and can be built with Docker using a Dockerfile, you can also deploy it this way.

  1. Set Container image is already built to false

  2. Specify the path to your Dockerfile from the root of your repository.

    Example: if your Dockerfile is in a folder named production, the path should be production/Dockerfile. If your Dockerfile is at root of the repository, the path should be Dockerfile.

  3. Next, fill in the port used by your service under Network / Port.

Service Metadata (3)

Whether you’re deploying from a Docker image or a Dockerfile, you must fill in some metadata about your service. In the Metadata form (3), complete the following fields:

  • Service name (capital letters are not allowed)

  • Service version

  • Service description

  • Icon URL

  • Homepage URL

You can also add keywords to improve search visibility within the service catalogue.

⚠️ If you want to replace an existing service with add-your-service, make sure you use a version number higher than the old version so that the replacement can take place.

For example, if the current version of the service is 1.1.2, you must have at least version 1.1.3, 1.2.0, or 2.0.0. In the Metadata section (1) you can customize the version number of your service (2):

Git (4)

You now need to provide Git repository access information in the Git section (4). There are two possiblities:

  1. If your repository is public:

    1. Enable Add git config inside your environment to allow internal Git configuration

    2. Provide the repository URL in Repository

  2. If your repository is private, provide your authentication information in the corresponding fields:

    1. Name

    2. Email

    3. Token (personal access token)

By default, the tool will pull files from the main branch of your repository. If you need to target another branch, specify its name in the Branch field.

Environment Variables (5)

If your project requires environment variables, you can define them in this section. Just complete the name, the description and the DefaultValue.

Resources (6)

Here you can define the resources on which the service will run. Your process will have at least the requested resources (1) and never more than its limits (2).

Once everything is ready, don't forget to save your add-your-process configuration by changing the friendly name (1) and clicking save (7).

You can then launch (8) the tool, and your process will be visible in the Service Playground catalogue within 5 minutes.

⚠️ Once you have deployed your service on EDITO, you may encounter the following error when attempting to launch it:

Onyxia API Error: Put /api/my-lab/app Response:500

In this case, we recommend opening a notebook with an “edit” role in order to view the exact error and resolve it more easily (it might be a wrong path in your add-your-service form for example).

Start Using Your Service


Once the forms are complete, launch the tool. When it completes successfully, it will automatically create your service.

Your service will be available within 5 minutes in the Service Playground catalogue. You can search by name to find it easily.

Customizing URL

Once you find your service, you can start it. You’ll have the option to customize its access URL under Ingress Details, for example: https://my-custom-name.lab.dive.edito.eu.

Configure environment variables

If your service needs environment variables, they will appear in the Inputs form.

You’re now ready to start and use your service!

What's next?


If you want to deploy a service on EDITO in a more advanced way, you can also create your own Helm chart!

If you have any questions, problems, or suggestions, please feel free to contact us via chat using the widget available at the bottom right of the page.

Did this answer your question?