Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions .env.dist

This file was deleted.

35 changes: 35 additions & 0 deletions .env.dist.compose
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# environment variables for installation with docker compose
# -----------------------------------------------------------
# fill these variables in case you want to install odtp with
# docker compose

# local setup and compose

# odtp db instance in the mongo db: "odtp"
ODTP_MONGO_DB=
# s3 bucket name: "odtp"
ODTP_BUCKET_NAME=

# s3 access and secret key
ODTP_ACCESS_KEY=
ODTP_SECRET_KEY=

# your github token
GITHUB_TOKEN=

# mongodb user and password
MONGO_DB_USER=
MONGO_DB_PASSWORD=

# mongoexpress user and password
MONGO_EXPRESS_USER=
MONGO_EXPRESS_PASSWORD=

# absolute path for docker volumes
ODTP_PATH=
MINIO_PATH=
MONGODB_PATH=

# Dashboard parameters
ODTP_DASHBOARD_PORT=
ODTP_DASHBOARD_RELOAD=
27 changes: 27 additions & 0 deletions .env.dist.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# environment variables for local installation
# ----------------------------------------------
# fill these variables in case you want to
# install otdp locally on your computer or
# on a server

# mongo url: example "mongodb://localhost:27017/"
ODTP_MONGO_SERVER=
# S3 server url: example: "https://s3.epfl.ch"
ODTP_S3_SERVER=

# odtp db instance in the mongo db: "odtp"
ODTP_MONGO_DB=

# s3 bucket name: "odtp"
ODTP_BUCKET_NAME=

# s3 access and secret key
ODTP_ACCESS_KEY=
ODTP_SECRET_KEY=

# your github token
GITHUB_TOKEN=

# Dashboard parameters
ODTP_DASHBOARD_PORT=
ODTP_DASHBOARD_RELOAD=
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Changelog

- v.0.2.2: Bugs correction
- Including submodules when cloning file

- v.0.2.1: Add docker compose for easy setup
- add compose.yml: it can be build with `docker compose up`
Expand Down
7 changes: 5 additions & 2 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,22 @@ services:
image: odtp
privileged: true
ports:
- "8000:8000"
- ${ODTP_DASHBOARD_PORT}:${ODTP_DASHBOARD_PORT}
- "8501:8501"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ${ODTP_PATH}:${ODTP_PATH}
environment:
ODTP_MONGO_SERVER: mongodb://${MONGO_DB_USER}:${MONGO_DB_PASSWORD}@mongodb-instance:27017/
ODTP_S3_SERVER: ${ODTP_S3_SERVER}
ODTP_S3_SERVER: http://minio-instance:9000
ODTP_BUCKET_NAME: ${ODTP_BUCKET_NAME}
ODTP_ACCESS_KEY: ${ODTP_ACCESS_KEY}
ODTP_SECRET_KEY: ${ODTP_SECRET_KEY}
GITHUB_TOKEN: ${GITHUB_TOKEN}
ODTP_MONGO_DB: ${ODTP_MONGO_DB}
ODTP_DASHBOARD_PORT: ${ODTP_DASHBOARD_PORT}
ODTP_DASHBOARD_RELOAD: ${ODTP_DASHBOARD_RELOAD}

stdin_open: true
tty: true
depends_on:
Expand Down
8 changes: 7 additions & 1 deletion odtp/dashboard/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from nicegui import app, native, ui
from odtp.helpers.settings import (ODTP_DASHBOARD_PORT, ODTP_DASHBOARD_RELOAD)

import odtp.dashboard.utils.ui_theme as ui_theme
from odtp.dashboard.pages.page_about import content as about_page
Expand Down Expand Up @@ -47,4 +48,9 @@ def components():

app.add_static_files("/static", "static")

ui.run(title="ODTP", storage_secret="private key to secure the browser session cookie")
ui.run(
title="ODTP",
storage_secret="private key to secure the browser session cookie",
port=ODTP_DASHBOARD_PORT,
reload=ODTP_DASHBOARD_RELOAD
)
2 changes: 2 additions & 0 deletions odtp/helpers/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
ODTP_BUCKET_NAME = os.getenv("ODTP_BUCKET_NAME")
ODTP_ACCESS_KEY = os.getenv("ODTP_ACCESS_KEY")
ODTP_SECRET_KEY = os.getenv("ODTP_SECRET_KEY")
ODTP_DASHBOARD_PORT = int(os.getenv("ODTP_DASHBOARD_PORT"))
ODTP_DASHBOARD_RELOAD = bool(os.getenv("ODTP_DASHBOARD_RELOAD"))
3 changes: 2 additions & 1 deletion odtp/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ def _download_repo(self):
logging.info(f"PREPARE: Downloading repository from {self.repo_url} to {self.repository_path}")
subprocess.run(
["git",
"clone",
"clone",
"--recurse-submodules",
self.repo_url,
os.path.join(self.project_folder, "repository")
]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='odtp',
version='0.2.1',
version='0.2.2',
packages=find_packages(),
description='Open Digital Twin Platform',
long_description=open('README.md').read(),
Expand Down