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
Show all changes
69 commits
Select commit Hold shift + click to select a range
eb6363f
chore: upgrade dependencied: pymongo, nicegui, black
sabinem May 13, 2024
437623f
chore: upgrade dependicies by using poetry update
sabinem May 13, 2024
df827db
chore: remove unused code barfi and models
sabinem May 15, 2024
47db7c6
Merge pull request #127 from odtp-org/package-upgrades
sabinem May 15, 2024
de9f253
refactor(dashboard execution pages): execution form user friendly
sabinem May 15, 2024
dd4d40c
Merge pull request #128 from odtp-org/improve-gui-execution-forms
sabinem May 15, 2024
4295c35
Merge pull request #129 from odtp-org/remove-unused-code
sabinem May 16, 2024
d0ed998
chore(config __init__.py): set log level to ERROR
sabinem May 18, 2024
980cb98
refactor(dashboard ui_theme.py): remove run page from menu
sabinem May 16, 2024
908c2d9
feat(dashboard ui_theme.py): add helper function for missing value
sabinem May 18, 2024
3eeb714
fix(dashboard helpers,py): fix bug in setting execution versions
sabinem May 22, 2024
27af980
style(dashboard parameters.py): rename new line in parameter form
sabinem May 18, 2024
1319aef
style(dashboard ports.py): rename ports mapping, improve layout
sabinem May 18, 2024
e68cc7c
style(dashboard page_about.py) improve about page
sabinem May 16, 2024
22df96e
style(dashbaord page_about.py): prettify page
sabinem May 18, 2024
7b16d9e
feat(dashboard page_about.py): reset storage on starting
sabinem May 22, 2024
013b7fe
style(dashboard page_user.py): improve workarea location
sabinem May 16, 2024
6de13a1
feat(dashboard page_user.py): working directory can be created
sabinem May 18, 2024
798209e
feat(dashboard page_user.py) select user after add
sabinem May 26, 2024
49cd7ad
style(dashboard page_components.py): put version add under select
sabinem May 16, 2024
c7679d1
style(dashboard page_components.py): improve layout of page
sabinem May 18, 2024
567af39
chore(dashboard: page_components.py): move function
sabinem May 22, 2024
fb5eb4e
style(dashboard page_digital_twins.py): prettify page
sabinem May 18, 2024
dc8c396
feat(dashboard page_digital_twins.py) select digital twin after add
sabinem May 26, 2024
0cc7cb7
style(dashboard page_executions.py): rename unselect button
sabinem May 16, 2024
f8650d6
feat(dashboard page_executioms.py): mark when uploaded parameters
sabinem May 18, 2024
e1c78c1
chore(dashboard page_executions.py): remove unused function
sabinem May 22, 2024
311ae7b
feat(dashboard page_executions.py): after execution add select it
sabinem May 22, 2024
e107d73
feat(dashboard page_run.py): enter page with an execution
sabinem May 18, 2024
8b6b3c4
chore(dashboard page_run.py storage.py): delete unused functions
sabinem May 22, 2024
585009a
save work on run page
sabinem May 27, 2024
ba4b7db
feat(dasgboard page_run.py): improve usability
sabinem May 28, 2024
46c196e
feat(logging and validation): improve form validation and logging
sabinem May 28, 2024
b45c2e5
fix(dashboard page_run.py): fix startup bug in run page
sabinem May 29, 2024
50e51e0
feat(logging): expose log level
sabinem May 29, 2024
3cbb876
style(dashboard): format code files with isort and black
sabinem May 29, 2024
023b965
fix(dashboard page_run.py): improve workflow in run steps
sabinem May 31, 2024
27ca178
refactor(dashboard page_about.py) split functionality from layout
sabinem May 31, 2024
6a56af5
refactor(dashboard page_users.py) split code file
sabinem May 31, 2024
3876fbd
chore(dashboard/page_users): improve error treatement
sabinem May 31, 2024
15db5b0
refactor(dashboard page_about.py) move into directory
sabinem Jun 1, 2024
9a73835
fix(dashboard page_users/workarea.py): form not refreshable
sabinem Jun 1, 2024
e7ee428
refactor(dashboard page_digital_twins) split code into files
sabinem Jun 1, 2024
b430d87
refactor(dashboard: page_executions): split code file
sabinem Jun 1, 2024
5d3ab64
chore(dashboard page_executions.py): remove unused module
sabinem Jun 1, 2024
708b0a6
chore(dashboard executions_page.py): remove unsude module file
sabinem Jun 1, 2024
0de0f1b
refactor(dashboard page_components.py): split code page
sabinem Jun 2, 2024
d4222ef
refactor(dashboard page_run.py) split into modules
sabinem Jun 2, 2024
8a98871
chore(odtp core modules): improve logging by adding a logger
sabinem Jun 3, 2024
2ce3f28
chore(logging): use logger for logging
sabinem Jun 3, 2024
a9e4f30
fix(dashboard: page_run and page_users): fix bugs
sabinem Jun 3, 2024
b21df83
fix(.env.dist.local): add equal sign after variable
sabinem Jun 14, 2024
5d77717
chore(pyproject.toml): upgrade version to 0.3.0
sabinem Jun 14, 2024
9e3bad2
fix(helpers:evironment): case of no output dirs
sabinem Jun 15, 2024
f947478
chore(.gitignore): ignore all .env files except dist
sabinem Jun 15, 2024
97f0802
feat(dashboard:homepage): add checks for database and git connect
sabinem Jun 17, 2024
29ceb22
feat(run.py workflow.py): improve run logs
sabinem Jun 17, 2024
e363c85
feat(settings): add extra log level for run
sabinem Jun 18, 2024
4a63f6e
fix(docker-compose): correct variable naming in compose
sabinem Jun 18, 2024
282f342
feat: Mount repository dir to /app
gabyx Jun 18, 2024
8b5efa3
fix(Dockerfile): first change into WORKDIR
sabinem Jun 18, 2024
0aec99f
fix(dashboard storage): build execution output
sabinem Jun 18, 2024
5742d5a
Merge pull request #141 from odtp-org/feature/make-sources-editable-i…
sabinem Jun 18, 2024
ecac206
fix(run.py): case of empty parameter
sabinem Jun 18, 2024
c6adef8
feat: Add pip install args (#142)
sabinem Jun 19, 2024
9744967
fix(.env.dist): PIP_INSTALL_ARGS belongs to the compose setupy
sabinem Jun 19, 2024
81f378e
chore(.env.dist): update .env.dist files with new settings
sabinem Jun 19, 2024
ae40e44
feat(compose.yml): split up into a dev and prod version
sabinem Jun 19, 2024
d857b8c
refactor(compose): rename dev compose file
sabinem Jun 19, 2024
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
12 changes: 11 additions & 1 deletion .env.dist.compose
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,14 @@ MONGODB_PATH=

# Dashboard parameters
ODTP_DASHBOARD_PORT=
ODTP_DASHBOARD_RELOAD=
ODTP_DASHBOARD_JSON_EDITOR=

# Log level
ODTP_LOG_LEVEL=
RUN_LOG_LEVEL=

# App Path
APP_PATH=

# Install the package in editable mode.
PIP_INSTALL_ARGS="--editable"
14 changes: 9 additions & 5 deletions .env.dist.local
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# environment variables for local installation
# ----------------------------------------------
# fill these variables in case you want to
# install otdp locally on your computer or
# fill these variables in case you want to
# install otdp locally on your computer or
# on a server

# mongo url: example "mongodb://localhost:27017/"
Expand All @@ -12,19 +12,23 @@ ODTP_S3_SERVER=
# odtp db instance in the mongo db: "odtp"
ODTP_MONGO_DB=

# s3 bucket name: "odtp"
# s3 bucket name: "odtp"
ODTP_BUCKET_NAME=

# s3 access and secret key
ODTP_ACCESS_KEY=
ODTP_ACCESS_KEY=
ODTP_SECRET_KEY=

# your github token
GITHUB_TOKEN=

# Dashboard parameters
ODTP_DASHBOARD_PORT=
ODTP_DASHBOARD_RELOAD=
ODTP_DASHBOARD_JSON_EDITOR=

# Working directory for user projects
ODTP_PATH=

# Log level
ODTP_LOG_LEVEL=
RUN_LOG_LEVEL=
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
__pycache__/
.DS_Store
.env
.env*
!.env*.dist
.nicegui
.env.bk
.local
12 changes: 4 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Use Docker in Docker stable version
FROM docker:25.0.3-dind-alpine3.19
ARG PIP_INSTALL_ARGS=

# Install dependencies required
RUN apk add --no-cache \
Expand All @@ -11,7 +12,7 @@ RUN apk add --no-cache \
zlib-dev \
git \
curl \
wget
wget

# Install Rust and Cargo using rustup (the Rust toolchain installer)
# Note: The following command installs the stable version of Rust and adds Cargo to the PATH
Expand All @@ -20,7 +21,7 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# Install system dependencies required for compiling Fortran and C++ code
# Needed for Numpy.
RUN apk add --no-cache \
curl \
curl \
gfortran \
g++ \
cmake \
Expand Down Expand Up @@ -60,17 +61,12 @@ RUN pip3 install --upgrade pip && \

# Add your application's source code
COPY . /app

WORKDIR /app

RUN pip3 install --upgrade pip && \
pip3 install --break-system-packages .
RUN pip3 install --break-system-packages $PIP_INSTALL_ARGS .

# Symbolic link between python and python3
RUN rm /usr/bin/python
RUN ln -s /usr/local/bin/python3 /usr/bin/python

WORKDIR /app

# Entry point in a sh session
ENTRYPOINT ["sh"]
90 changes: 90 additions & 0 deletions compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
version: "3.8"

services:
odtp:
build:
context: .
args:
PIP_INSTALL_ARGS: ${PIP_INSTALL_ARGS}
image: odtp
privileged: true
ports:
- ${ODTP_DASHBOARD_PORT}:${ODTP_DASHBOARD_PORT}
- "8501:8501"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ${ODTP_PATH}:${ODTP_PATH}
- ${APP_PATH}:/app
environment:
ODTP_PATH: ${ODTP_PATH}
ODTP_MONGO_SERVER: mongodb://${MONGO_DB_USER}:${MONGO_DB_PASSWORD}@mongodb-instance:27017/
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}
ODTP_DASHBOARD_JSON_EDITIOR: ${ODTP_DASHBOARD_JSON_EDITIOR}
ODTP_LOG_LEVEL: ${ODTP_LOG_LEVEL}
RUN_LOG_LEVEL: ${ODTP_LOG_LEVEL}

stdin_open: true
tty: true
networks:
- odtp-network
depends_on:
- mongodb-instance
- mongodb-express
- minio-instance

mongodb-instance:
image: mongo:7.0.8
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_DB_USER}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_DB_PASSWORD}
MONGO_INITDB_DATABASE: ${ODTP_MONGO_DB}
networks:
- odtp-network
volumes:
- ${MONGODB_PATH}:/data/db

mongodb-express:
image: mongo-express:1.0.2-18
ports:
- "8081:8081"
environment:
ME_CONFIG_OPTIONS_EDITORTHEME: "ambiance"
ME_CONFIG_BASICAUTH_USERNAME: ${MONGO_EXPRESS_USER}
ME_CONFIG_BASICAUTH_PASSWORD: ${MONGO_EXPRESS_PASSWORD}
ME_CONFIG_MONGODB_URL: mongodb://${MONGO_DB_USER}:${MONGO_DB_PASSWORD}@mongodb-instance:27017/
ME_CONFIG_MONGODB_ENABLE_ADMIN: true
networks:
- odtp-network
depends_on:
- mongodb-instance

minio-instance:
image: minio/minio:RELEASE.2024-03-30T09-41-56Z
ports:
- "9000:9000"
- "9001:9001"
environment:
MINIO_ROOT_USER: ${ODTP_ACCESS_KEY}
MINIO_ROOT_PASSWORD: ${ODTP_SECRET_KEY}
command: server --console-address :9001 /data
networks:
- odtp-network
volumes:
- ${MINIO_PATH}:/data

volumes:
mongodb_data:
minio_data:

networks:
odtp-network:
driver: bridge
11 changes: 7 additions & 4 deletions compose.yml → compose.prod.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3.8'
version: "3.8"

services:
odtp:
Expand All @@ -11,6 +11,7 @@ services:
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ${ODTP_PATH}:${ODTP_PATH}
- ${APP_PATH}:/app
environment:
ODTP_PATH: ${ODTP_PATH}
ODTP_MONGO_SERVER: mongodb://${MONGO_DB_USER}:${MONGO_DB_PASSWORD}@mongodb-instance:27017/
Expand All @@ -21,8 +22,10 @@ services:
GITHUB_TOKEN: ${GITHUB_TOKEN}
ODTP_MONGO_DB: ${ODTP_MONGO_DB}
ODTP_DASHBOARD_PORT: ${ODTP_DASHBOARD_PORT}
ODTP_DASHBOARD_RELOAD: ${ODTP_DASHBOARD_RELOAD}

ODTP_DASHBOARD_JSON_EDITIOR: ${ODTP_DASHBOARD_JSON_EDITIOR}
ODTP_LOG_LEVEL: ${ODTP_LOG_LEVEL}
RUN_LOG_LEVEL: ${ODTP_LOG_LEVEL}

stdin_open: true
tty: true
networks:
Expand All @@ -39,7 +42,7 @@ services:
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_DB_USER}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_DB_PASSWORD}
MONGO_INITDB_DATABASE: ${ODTP_MONGO_DB}
MONGO_INITDB_DATABASE: ${ODTP_MONGO_DB}
networks:
- odtp-network
volumes:
Expand Down
20 changes: 13 additions & 7 deletions odtp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@

import logging
import importlib.metadata as importlib_metadata
from odtp.helpers.settings import ODTP_LOG_LEVEL


__version__ = importlib_metadata.version(__name__)
logging.basicConfig(#filename='my_logs.log',
#encoding='utf-8',
#filemode='w',
format='%(levelname)s (%(asctime)s): %(message)s (LineL %(lineno)d [%(filename)s])',
datefmt='%d/%m/%Y %I:%M:%S %p',
level=logging.INFO)
# logging.info('The answer is: %s', x) #Variable.

logging.basicConfig(
format='%(asctime)s - [%(module)s:%(levelname)s] %(lineno)d %(filename)s %(funcName)s - %(message)s',
datefmt='%d/%m/%Y %I:%M:%S %p',
level=logging.ERROR
)

valid_log_levels = logging.getLevelNamesMapping()

if ODTP_LOG_LEVEL in valid_log_levels.keys():
logging.getLogger().setLevel(ODTP_LOG_LEVEL)
72 changes: 0 additions & 72 deletions odtp/barfi.py

This file was deleted.

4 changes: 2 additions & 2 deletions odtp/cli/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def run(
help="Specify the path to the environment file"
)] = None,
ports: Annotated[str, typer.Option(
help="Specify port mappings seperated by a plus sign i.e. 8501:8501+8201:8201"
help="Specify port mappings separated by a plus sign i.e. 8501:8501+8201:8201"
)] = None,
):
try:
Expand All @@ -71,7 +71,7 @@ def run(
image_name=image_name,
)
ports = odtp_parse.parse_port_mappings_for_one_component(ports)
parameters = odtp_parse.parse_paramters_for_one_file(parameter_file)
parameters = odtp_parse.parse_parameters_for_one_file(parameter_file)
componentManager.run_component(
parameters=parameters,
ports=ports,
Expand Down
3 changes: 1 addition & 2 deletions odtp/cli/execution.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""
This scripts contains odtp subcommands for 'execution'
"""
import logging

import typer
from typing_extensions import Annotated
Expand Down Expand Up @@ -104,7 +103,7 @@ def output(
display_tree(project_path)
except Exception as e:
print(f"ERROR: Output printing failed: {e}")
raise typer.Abort()
raise typer.Abort()


if __name__ == "__main__":
Expand Down
1 change: 0 additions & 1 deletion odtp/cli/new.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import odtp.mongodb.db as db
import odtp.helpers.parse as odtp_parse
import odtp.mongodb.utils as db_utils
import odtp.helpers.utils as odtp_utils
import odtp.helpers.git as odtp_git


Expand Down
Loading