From 76bd7bbcd680e9096de753bce68698ebad204326 Mon Sep 17 00:00:00 2001 From: EdwinWiseOne Date: Wed, 20 Nov 2024 11:02:52 -0600 Subject: [PATCH] Back out 111 changes --- .github/workflows/test-examples.yaml | 4 ++-- Kubernetes/devspace.yaml | 4 ++-- Minimal/Dockerfile | 7 ++----- Minimal/app_config.yaml | 11 ++++------- Minimal/bootstrap.py | 3 +-- Minimal/ci/__main__.py | 7 ++++--- Minimal/requirements.txt | 1 - Panel/Dockerfile | 3 --- Panel/app_config.yaml | 24 +++++++++++------------- Panel/bootstrap.py | 3 +-- Panel/ci/__main__.py | 7 ++++--- Panel/requirements.txt | 1 - Plotly Dash/Dockerfile | 6 +++--- Plotly Dash/app_config.yaml | 27 ++++++++++++--------------- Plotly Dash/bootstrap.py | 3 +-- Plotly Dash/ci/__main__.py | 7 ++++--- Plotly Dash/requirements.txt | 2 -- React/Dockerfile | 6 +++--- React/app_config.yaml | 23 ++++++++++------------- React/bootstrap.py | 3 +-- React/ci/__main__.py | 7 ++++--- React/requirements.txt | 1 - Streamlit/Dockerfile | 6 +++--- Streamlit/app_config.yaml | 19 +++++++------------ Streamlit/bootstrap.py | 3 +-- Streamlit/ci/__main__.py | 7 ++++--- Streamlit/requirements.txt | 3 --- Tools/bootstrap.py | 3 +-- 28 files changed, 85 insertions(+), 116 deletions(-) delete mode 100644 Minimal/requirements.txt delete mode 100644 Panel/requirements.txt delete mode 100644 Plotly Dash/requirements.txt delete mode 100644 React/requirements.txt delete mode 100644 Streamlit/requirements.txt diff --git a/.github/workflows/test-examples.yaml b/.github/workflows/test-examples.yaml index 8c16c38..7e81f00 100644 --- a/.github/workflows/test-examples.yaml +++ b/.github/workflows/test-examples.yaml @@ -11,7 +11,7 @@ jobs: env: SHELL: /bin/bash - INSTALLED_EDM_VERSION: "4.0.0" + INSTALLED_EDM_VERSION: "3.7.0" EDM_API_TOKEN: ${{ secrets.HATCHER_TOKEN }} strategy: @@ -51,7 +51,7 @@ jobs: fetch-depth: 0 - name: Set up EDM - uses: enthought/setup-edm-action@v4 + uses: enthought/setup-edm-action@v2 with: edm-version: ${{ env.INSTALLED_EDM_VERSION }} diff --git a/Kubernetes/devspace.yaml b/Kubernetes/devspace.yaml index 1af9c50..829e57f 100644 --- a/Kubernetes/devspace.yaml +++ b/Kubernetes/devspace.yaml @@ -49,7 +49,7 @@ hooks: command: |- $!( if ! [ -f ./src/app_environment.zbundle ] || [ $(get_flag "rebuild-zbundle") == "true" ]; then - echo 'edm bundle generate -i --version 3.11 --platform rh8-x86_64 -m 2.0 -f ./src/app_environment.zbundle ${EDM_APP_DEPENDENCIES}' + echo 'edm bundle generate -i --version 3.8 --platform rh7-x86_64 -m 2.0 -f ./src/app_environment.zbundle ${EDM_APP_DEPENDENCIES}' else echo '' fi @@ -77,7 +77,7 @@ commands: cd deploy/terraform/deployments/devspace terraform init create-edm-devenv: |- - edm env create ${DEVSPACE_NAME} --version 3.11 --platform rh8-x86_64 + edm env create ${DEVSPACE_NAME} --version 3.8 edm install -e ${DEVSPACE_NAME} -y ${EDM_APP_DEPENDENCIES} functions: diff --git a/Minimal/Dockerfile b/Minimal/Dockerfile index 4e0ccf2..ee6b6a8 100644 --- a/Minimal/Dockerfile +++ b/Minimal/Dockerfile @@ -20,7 +20,7 @@ ARG BASE_IMAGE=quay.io/enthought/edm-rockylinux-8:latest -FROM $BASE_IMAGE AS stage_one +FROM $BASE_IMAGE as stage_one ARG EDGE_BUNDLE=app_environment.zbundle COPY $EDGE_BUNDLE /tmp/app_environment.zbundle @@ -32,13 +32,10 @@ WORKDIR /home/app # Create a default EDM environment using the enthought_edge bundle RUN edm env import -f /tmp/app_environment.zbundle edm && edm cache purge --yes -# Add any 'pip' packages to the application environment -COPY requirements.txt /tmp/requirements.txt -RUN edm run -- python -m pip install -r /tmp/requirements.txt --no-cache-dir # Second stage -FROM $BASE_IMAGE AS stage_two +FROM $BASE_IMAGE as stage_two LABEL source="https://github.com/enthought/edge-examples/blob/main/Minimal/Dockerfile" diff --git a/Minimal/app_config.yaml b/Minimal/app_config.yaml index 87c30bd..2641faa 100644 --- a/Minimal/app_config.yaml +++ b/Minimal/app_config.yaml @@ -18,13 +18,10 @@ env_deps: pip: - questionary app_deps: - edm: - - flask - - pip - - setuptools - - gunicorn - - enthought_edge - pip: [] +- flask +- setuptools +- gunicorn +- enthought_edge cmd_deps: - docker exclude: diff --git a/Minimal/bootstrap.py b/Minimal/bootstrap.py index 8663a22..3487372 100644 --- a/Minimal/bootstrap.py +++ b/Minimal/bootstrap.py @@ -27,8 +27,7 @@ def bootstrap(ci_mode): if ENV_NAME not in _list_edm_envs(): print(f"Creating development environment '{ENV_NAME}'...") - cmd = ["edm", "envs", "create", ENV_NAME, "--version", "3.11", - "--platform", "rh8-x86_64", "--force"] + cmd = ["edm", "envs", "create", ENV_NAME, "--version", "3.8", "--force"] subprocess.run(cmd, check=True) cmd = ["edm", "install", "-e", ENV_NAME, "-y"] + EDM_DEPS diff --git a/Minimal/ci/__main__.py b/Minimal/ci/__main__.py index 2605ca5..1be01d7 100644 --- a/Minimal/ci/__main__.py +++ b/Minimal/ci/__main__.py @@ -45,11 +45,12 @@ def build(config, bundle_image, rebuild_zbundle, verbose): # Configuration details bundle_image = bundle_image or _bundle_image(config) version = config["app_version"] - app_deps = config["app_deps"]["edm"] + app_deps = config["app_deps"] python_version = str(config["python_version"]) if python_version == "3.8": - raise RuntimeError("Python 3.8 is not supported") - platform = "rh8-x86_64" + platform = "rh7-x86_64" + else: + platform = "rh8-x86_64" # First, we build a "zbundle" which contains all the eggs needed to # build the environment within the Docker image. diff --git a/Minimal/requirements.txt b/Minimal/requirements.txt deleted file mode 100644 index 4aa7e84..0000000 --- a/Minimal/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -# No pip requirements diff --git a/Panel/Dockerfile b/Panel/Dockerfile index b0173fd..085811c 100644 --- a/Panel/Dockerfile +++ b/Panel/Dockerfile @@ -32,9 +32,6 @@ WORKDIR /home/app # Create a default EDM environment using the enthought_edge bundle RUN edm env import -f /tmp/app_environment.zbundle edm && edm cache purge --yes -# Add any 'pip' packages to the application environment -COPY requirements.txt /tmp/requirements.txt -RUN edm run -- python -m pip install -r /tmp/requirements.txt --no-cache-dir # Second stage diff --git a/Panel/app_config.yaml b/Panel/app_config.yaml index ce8ef13..873e06d 100644 --- a/Panel/app_config.yaml +++ b/Panel/app_config.yaml @@ -1,7 +1,7 @@ app_id: edge-panel-example framework: panel app_version: 1.3.0 -python_version: 3.11 +python_version: 3.8 repository: quay.io organisation: enthought env_deps: @@ -18,18 +18,16 @@ env_deps: pip: - questionary app_deps: - edm: - - enthought_edge>=2.16.0 - - packaging - - pip - - pyparsing - - setuptools - - six - - numpy - - pandas - - matplotlib - pip: - - panel +- enthought_edge>=2.16.0 +- packaging +- pip +- pyparsing +- setuptools +- six +- panel +- numpy +- pandas +- matplotlib cmd_deps: - docker exclude: diff --git a/Panel/bootstrap.py b/Panel/bootstrap.py index 43e4e1e..9f1ae50 100644 --- a/Panel/bootstrap.py +++ b/Panel/bootstrap.py @@ -27,8 +27,7 @@ def bootstrap(ci_mode): if ENV_NAME not in _list_edm_envs(): print(f"Creating development environment '{ENV_NAME}'...") - cmd = ["edm", "envs", "create", ENV_NAME, "--version", "3.11", - "--platform", "rh8-x86_64", "--force"] + cmd = ["edm", "envs", "create", ENV_NAME, "--version", "3.8", "--force"] subprocess.run(cmd, check=True) cmd = ["edm", "install", "-e", ENV_NAME, "-y"] + EDM_DEPS diff --git a/Panel/ci/__main__.py b/Panel/ci/__main__.py index f73bd4f..86a3117 100644 --- a/Panel/ci/__main__.py +++ b/Panel/ci/__main__.py @@ -45,11 +45,12 @@ def build(config, bundle_image, rebuild_zbundle, verbose): # Configuration details bundle_image = bundle_image or _bundle_image(config) version = config["app_version"] - app_deps = config["app_deps"]["edm"] + app_deps = config["app_deps"] python_version = str(config["python_version"]) if python_version == "3.8": - raise RuntimeError("Python 3.8 is not supported") - platform = "rh8-x86_64" + platform = "rh7-x86_64" + else: + platform = "rh8-x86_64" # First, we build a "zbundle" which contains all the eggs needed to # build the environment within the Docker image. diff --git a/Panel/requirements.txt b/Panel/requirements.txt deleted file mode 100644 index f9ec12d..0000000 --- a/Panel/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -panel diff --git a/Plotly Dash/Dockerfile b/Plotly Dash/Dockerfile index 1fd3603..6d4fd9c 100644 --- a/Plotly Dash/Dockerfile +++ b/Plotly Dash/Dockerfile @@ -32,9 +32,9 @@ WORKDIR /home/app # Create a default EDM environment using the enthought_edge bundle RUN edm env import -f /tmp/app_environment.zbundle edm && edm cache purge --yes -# Add any 'pip' packages to the application environment -COPY requirements.txt /tmp/requirements.txt -RUN edm run -- python -m pip install -r /tmp/requirements.txt --no-cache-dir +# Install any 'pip' dependencies +RUN edm run -- pip install --no-cache-dir Flask-Session + # Second stage diff --git a/Plotly Dash/app_config.yaml b/Plotly Dash/app_config.yaml index 173554c..72ab5a6 100644 --- a/Plotly Dash/app_config.yaml +++ b/Plotly Dash/app_config.yaml @@ -1,7 +1,7 @@ app_id: edge-plotly-dash-example framework: plotly-dash app_version: 1.3.0 -python_version: 3.11 +python_version: 3.8 repository: quay.io organisation: enthought env_deps: @@ -18,20 +18,17 @@ env_deps: pip: - questionary app_deps: - edm: - - enthought_edge>=2.16.0 - - packaging - - pip - - pyparsing - - setuptools - - six - - requests - - gunicorn - - pandas - - flask>2 - pip: - - dash - - Flask-Session +- enthought_edge>=2.16.0 +- packaging +- pip +- pyparsing +- setuptools +- six +- requests +- gunicorn +- pandas +- flask>2 +- dash cmd_deps: - docker exclude: diff --git a/Plotly Dash/bootstrap.py b/Plotly Dash/bootstrap.py index 13846a4..1818a2c 100644 --- a/Plotly Dash/bootstrap.py +++ b/Plotly Dash/bootstrap.py @@ -27,8 +27,7 @@ def bootstrap(ci_mode): if ENV_NAME not in _list_edm_envs(): print(f"Creating development environment '{ENV_NAME}'...") - cmd = ["edm", "envs", "create", ENV_NAME, "--version", "3.11", - "--platform", "rh8-x86_64", "--force"] + cmd = ["edm", "envs", "create", ENV_NAME, "--version", "3.8", "--force"] subprocess.run(cmd, check=True) cmd = ["edm", "install", "-e", ENV_NAME, "-y"] + EDM_DEPS diff --git a/Plotly Dash/ci/__main__.py b/Plotly Dash/ci/__main__.py index ef97997..942917f 100644 --- a/Plotly Dash/ci/__main__.py +++ b/Plotly Dash/ci/__main__.py @@ -45,11 +45,12 @@ def build(config, bundle_image, rebuild_zbundle, verbose): # Configuration details bundle_image = bundle_image or _bundle_image(config) version = config["app_version"] - app_deps = config["app_deps"]["edm"] + app_deps = config["app_deps"] python_version = str(config["python_version"]) if python_version == "3.8": - raise RuntimeError("Python 3.8 is not supported") - platform = "rh8-x86_64" + platform = "rh7-x86_64" + else: + platform = "rh8-x86_64" # First, we build a "zbundle" which contains all the eggs needed to # build the environment within the Docker image. diff --git a/Plotly Dash/requirements.txt b/Plotly Dash/requirements.txt deleted file mode 100644 index 633b4b7..0000000 --- a/Plotly Dash/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -dash -Flask-Session diff --git a/React/Dockerfile b/React/Dockerfile index 11e20cc..68bec91 100644 --- a/React/Dockerfile +++ b/React/Dockerfile @@ -32,9 +32,9 @@ WORKDIR /home/app # Create a default EDM environment using the enthought_edge bundle RUN edm env import -f /tmp/app_environment.zbundle edm && edm cache purge --yes -# Add any 'pip' packages to the application environment -COPY requirements.txt /tmp/requirements.txt -RUN edm run -- python -m pip install -r /tmp/requirements.txt --no-cache-dir +# Install any 'pip' dependencies +RUN edm run -- pip install --no-cache-dir Flask-Session + # Second stage diff --git a/React/app_config.yaml b/React/app_config.yaml index f954f84..d1db476 100644 --- a/React/app_config.yaml +++ b/React/app_config.yaml @@ -19,19 +19,16 @@ env_deps: pip: - questionary app_deps: - edm: - - enthought_edge>=2.16.0 - - packaging - - pip - - pyparsing - - setuptools - - six - - click - - flask>2 - - gunicorn - - opencv_python - pip: - - Flask-Session +- enthought_edge>=2.16.0 +- packaging +- pip +- pyparsing +- setuptools +- six +- click +- flask>2 +- gunicorn +- opencv_python cmd_deps: - docker exclude: diff --git a/React/bootstrap.py b/React/bootstrap.py index a06a335..c447c69 100644 --- a/React/bootstrap.py +++ b/React/bootstrap.py @@ -27,8 +27,7 @@ def bootstrap(ci_mode): if ENV_NAME not in _list_edm_envs(): print(f"Creating development environment '{ENV_NAME}'...") - cmd = ["edm", "envs", "create", ENV_NAME, "--version", "3.11", - "--platform", "rh8-x86_64", "--force"] + cmd = ["edm", "envs", "create", ENV_NAME, "--version", "3.8", "--force"] subprocess.run(cmd, check=True) cmd = ["edm", "install", "-e", ENV_NAME, "-y"] + EDM_DEPS diff --git a/React/ci/__main__.py b/React/ci/__main__.py index 9bd7491..3dec34a 100644 --- a/React/ci/__main__.py +++ b/React/ci/__main__.py @@ -45,11 +45,12 @@ def build(config, bundle_image, rebuild_zbundle, verbose): # Configuration details bundle_image = bundle_image or _bundle_image(config) version = config["app_version"] - app_deps = config["app_deps"]["edm"] + app_deps = config["app_deps"] python_version = str(config["python_version"]) if python_version == "3.8": - raise RuntimeError("Python 3.8 is not supported") - platform = "rh8-x86_64" + platform = "rh7-x86_64" + else: + platform = "rh8-x86_64" # First, build the React application jsdir = op.join(SRC_ROOT, "src", "application", "frontend") diff --git a/React/requirements.txt b/React/requirements.txt deleted file mode 100644 index 1adea34..0000000 --- a/React/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -Flask-Session diff --git a/Streamlit/Dockerfile b/Streamlit/Dockerfile index 95460e7..dfd1f54 100644 --- a/Streamlit/Dockerfile +++ b/Streamlit/Dockerfile @@ -32,9 +32,9 @@ WORKDIR /home/app # Create a default EDM environment using the enthought_edge bundle RUN edm env import -f /tmp/app_environment.zbundle edm && edm cache purge --yes -# Add any 'pip' packages to the application environment -COPY requirements.txt /tmp/requirements.txt -RUN edm run -- python -m pip install -r /tmp/requirements.txt --no-cache-dir +# Add a few 'pip' packages to the application environment +RUN edm run -- python -m pip install --no-cache-dir \ + streamlit streamlit-javascript streamlit-extras # Second stage diff --git a/Streamlit/app_config.yaml b/Streamlit/app_config.yaml index f2c06cb..328d3a6 100644 --- a/Streamlit/app_config.yaml +++ b/Streamlit/app_config.yaml @@ -18,18 +18,13 @@ env_deps: pip: - questionary app_deps: - edm: - - enthought_edge>=2.16.0 - - packaging - - pip - - pyparsing - - setuptools - - six - - requests - pip: - - streamlit - - streamlit-javascript - - streamlit-extras +- enthought_edge>=2.16.0 +- packaging +- pip +- pyparsing +- setuptools +- six +- requests cmd_deps: - docker exclude: diff --git a/Streamlit/bootstrap.py b/Streamlit/bootstrap.py index a8c8748..26ba1de 100644 --- a/Streamlit/bootstrap.py +++ b/Streamlit/bootstrap.py @@ -27,8 +27,7 @@ def bootstrap(ci_mode): if ENV_NAME not in _list_edm_envs(): print(f"Creating development environment '{ENV_NAME}'...") - cmd = ["edm", "envs", "create", ENV_NAME, "--version", "3.11", - "--platform", "rh8-x86_64", "--force"] + cmd = ["edm", "envs", "create", ENV_NAME, "--version", "3.8", "--force"] subprocess.run(cmd, check=True) cmd = ["edm", "install", "-e", ENV_NAME, "-y"] + EDM_DEPS diff --git a/Streamlit/ci/__main__.py b/Streamlit/ci/__main__.py index 442cdb3..4418802 100644 --- a/Streamlit/ci/__main__.py +++ b/Streamlit/ci/__main__.py @@ -45,11 +45,12 @@ def build(config, bundle_image, rebuild_zbundle, verbose): # Configuration details bundle_image = bundle_image or _bundle_image(config) version = config["app_version"] - app_deps = config["app_deps"]["edm"] + app_deps = config["app_deps"] python_version = str(config["python_version"]) if python_version == "3.8": - raise RuntimeError("Python 3.8 is not supported") - platform = "rh8-x86_64" + platform = "rh7-x86_64" + else: + platform = "rh8-x86_64" # First, we build a "zbundle" which contains all the eggs needed to # build the environment within the Docker image. diff --git a/Streamlit/requirements.txt b/Streamlit/requirements.txt deleted file mode 100644 index 32f2967..0000000 --- a/Streamlit/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -streamlit -streamlit-javascript -streamlit-extras diff --git a/Tools/bootstrap.py b/Tools/bootstrap.py index 61aed10..f181816 100644 --- a/Tools/bootstrap.py +++ b/Tools/bootstrap.py @@ -26,8 +26,7 @@ def bootstrap(ci_mode): if ENV_NAME not in _list_edm_envs(): print(f"Creating development environment {ENV_NAME}...") - cmd = ["edm", "envs", "create", ENV_NAME, "--version", "3.11", - "--platform", "rh8-x86_64", "--force"] + cmd = ["edm", "envs", "create", ENV_NAME, "--version", "3.8", "--force"] subprocess.run(cmd, check=True) cmd = ["edm", "install", "-e", ENV_NAME, "-y"] + EDM_DEPS