GithubHelp home page GithubHelp logo

streamlit-deployment's Introduction

OpenMS streamlit app deployment

Multiple streamlit apps based on the OpenMS streamlit template can be deployed together using docker compose.

Features

  • deploy all OpenMS apps at once
  • user data (in workspaces) is stored in persistent docker volumes for each app

Requirements

  • Docker Compose

Deployment (e.g., needed after one app changed)

1. Make sure submodules are up-to-data.

git submodule init

git submodule update

2. Specify GitHub token (to download Windows executables).

This is important! Ommitting this step while result in all apps not having the option to download exetutables any more.

Create a temporary .env file with your Github token. It should contain only one line:

GITHUB_TOKEN=<your-github-token>

3. Run docker-compose.

docker-compose up --build -d

Make sure to remove the .env file with your Github token after successfull build

Add new app

This will add your app as a submodule to the streamlit deployment repository.

1. Fork and clone the OpenMS streamlit deployment repository locally.

2. Add your app as submodule. Make sure the app name is not used already.

git submodule add <url-to-git-repository> <name-of-app>

3. Initialize and update submodules.

git submodule init

git submodule update

4. Add your app to docker-compose.yml file as a new service.

Copy the last service as a template.

Check and update the following entries:

  • name of the service
    • the name of the submodule
  • build context
    • the relative path to the submodule
  • build dockerfile
    • the correct Dockerfile
  • image
    • name of the docker image (typically the service name with underscores)
  • ports
    • chose an incremental host port number from the last service pointing to the streamlit port in docker container (8501)
  • volumes
    • update the names of the workspace directories, user data is stored outside of the docker container in a docker volume
  • command
    • update command with your main streamlit file

6. Test everything works locally.

Run docker-compose to launch all services.

docker-compose up --build -d

  • there should be no errors building all services
  • make sure all apps are accessible via their port from localhost
  • test functionality of your app

7. Make a pull request with your changes to OpenMS/streamlit-deployment main branch.

streamlit-deployment's People

Contributors

arslan-siraj avatar axelwalter avatar dependabot[bot] avatar jeeh-k avatar joeychrys avatar poshul avatar t0mdavid-m avatar timosachsenberg avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.