-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move app runner code into separate package
- Loading branch information
1 parent
7c9c591
commit bff9583
Showing
36 changed files
with
136 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
.idea/ | ||
__pycache__ | ||
bfabric.egg-info/ | ||
*.egg-info/ | ||
bfabric/scripts/query_result.txt | ||
build/ | ||
dist/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
builds | ||
app_runner.spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
# Parse arguments | ||
TARGET_DIR=$(readlink -f "${1:-./dist}") | ||
TARGET_NAME="${2:-app_runner}" | ||
DOCKER=docker | ||
|
||
DEPLOY_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
APP_RUNNER_PROJECT_DIR=$(realpath "$DEPLOY_DIR/..") | ||
BUILDER_IMAGE=local-build_app_runner:0.0.1 | ||
$DOCKER build -t $BUILDER_IMAGE "$DEPLOY_DIR/builder" | ||
|
||
mkdir -p "$TARGET_DIR" | ||
$DOCKER run \ | ||
--user "$(id -u):$(id -g)" \ | ||
--rm \ | ||
--mount type=bind,source="$APP_RUNNER_PROJECT_DIR",target=/work/app_runner \ | ||
--mount type=bind,source="$DEPLOY_DIR"/build_steps.sh,target=/work/build_steps.sh,readonly \ | ||
--mount type=bind,source="$TARGET_DIR",target=/work/dist \ | ||
--workdir /work/app_runner \ | ||
"$BUILDER_IMAGE" \ | ||
bash /work/build_steps.sh /work/dist "$TARGET_NAME" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
TARGET_DIR="${1:-dist}" | ||
TARGET_NAME="${2:-app_runner}" | ||
rm -rf /work/venv | ||
python -m venv /work/venv | ||
source /work/venv/bin/activate | ||
uv pip install . | ||
uv pip install pyinstaller | ||
pyinstaller -y --onedir --name "${TARGET_NAME}" --distpath "${TARGET_DIR}" src/app_runner/cli/__main__.py | ||
deactivate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
ARG DEBIAN_VERSION=buster | ||
FROM debian:${DEBIAN_VERSION} | ||
ARG PYTHON_VERSION=3.13.0 | ||
|
||
LABEL org.opencontainers.image.authors="Leonardo Schwarz" | ||
|
||
RUN apt-get update \ | ||
&& apt-get upgrade -y \ | ||
&& apt-get install -y curl git bash build-essential ccache \ | ||
&& apt-get install -y libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl git libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev | ||
|
||
RUN curl https://pyenv.run | bash | ||
|
||
ENV PATH=$PATH:/root/.pyenv/bin | ||
RUN pyenv install $PYTHON_VERSION | ||
RUN pyenv global $PYTHON_VERSION | ||
ENV PATH=/root/.pyenv/versions/${PYTHON_VERSION}/bin:$PATH | ||
|
||
RUN pip install --root-user-action ignore uv pyinstaller | ||
RUN chmod -R 0777 /root | ||
RUN mkdir /work && chmod 0777 /work | ||
RUN mkdir /home/user && chmod 0777 /home/user | ||
|
||
ENV HOME=/home/user | ||
WORKDIR /work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[build-system] | ||
requires = ["setuptools >= 61.0"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "app_runner" | ||
description = "Application runner for B-Fabric apps" | ||
version = "0.1.0" | ||
license = { text = "GPL-3.0" } | ||
authors = [ | ||
{name = "Leonardo Schwarz", email = "[email protected]"}, | ||
] | ||
requires-python = ">=3.12" | ||
dependencies = [ | ||
"bfabric @ git+https://github.com/fgcz/bfabricPy.git@main", | ||
] | ||
|
||
[project.scripts] | ||
"bfabric-app-runner"="app_runner.cli.__main__:app" |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from __future__ import annotations | ||
|
||
import cyclopts | ||
|
||
from app_runner.cli.app import app_app | ||
from app_runner.cli.chunk import app_chunk | ||
from app_runner.cli.inputs import app_inputs | ||
from app_runner.cli.outputs import app_outputs | ||
from app_runner.cli.validate import app_validate | ||
|
||
app = cyclopts.App(help="Provides an entrypoint to app execution.\n\nFunctionality/API under active development!") | ||
app.command(app_inputs) | ||
app.command(app_outputs) | ||
app.command(app_app) | ||
app.command(app_chunk) | ||
app.command(app_validate) | ||
|
||
if __name__ == "__main__": | ||
app() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters