Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additions for Edge CLI support #85

Merged
merged 12 commits into from
Jun 19, 2024
2 changes: 1 addition & 1 deletion Minimal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ version = AppVersion(
description="This Is An Example Edge Application",
icon=ICON,
kind=AppKindEnum.Native,
proxy_kind=AppProxyKindEnum.Generic,
framework=AppProxyKindEnum.Generic,
link="quay.io/<YOUR_ORGANIZATION>/YOUR_IMAGE_NAME_HERE:TAG",
recommended_profile="edge.medium"
)
Expand Down
13 changes: 13 additions & 0 deletions Minimal/app_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"env_name": "edge-minimal-example",
"edm_deps": [
"click",
"pip",
"setuptools"
],
"cmd_deps": [
"docker"
],
"framework": "generic",
"app_id": null
}
14 changes: 9 additions & 5 deletions Minimal/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@

import argparse
import subprocess
import json

ENV_NAME = "edge-minimal-example"
EDM_DEPS = ["click", "pip", "setuptools"]

with open("app_config.json", "r") as f:
config = json.load(f)
ENV_NAME = config["env_name"]
EDM_DEPS = config["cmd_deps"]


def bootstrap(ci_mode):
Expand All @@ -25,7 +29,7 @@ def bootstrap(ci_mode):
"""

if ENV_NAME not in _list_edm_envs():
print(f"Creating development environment {ENV_NAME}...")
print(f"Creating development environment '{ENV_NAME}'...")
cmd = ["edm", "envs", "create", ENV_NAME, "--version", "3.8", "--force"]
subprocess.run(cmd, check=True)

Expand All @@ -35,10 +39,10 @@ def bootstrap(ci_mode):
print("Bootstrap complete.")

else:
print("Environment already exists; reusing.")
print(f"Environment '{ENV_NAME}' already exists; reusing.")

if not ci_mode:
print(f"Activating dev environment {ENV_NAME}")
print(f"Activating environment '{ENV_NAME}'")
subprocess.run(["edm", "shell", "-e", ENV_NAME])


Expand Down
2 changes: 1 addition & 1 deletion Panel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ version = AppVersion(
description="This Is An Example Edge Application",
icon=ICON,
kind=AppKindEnum.Native,
proxy_kind=AppProxyKindEnum.Panel,
framework=AppProxyKindEnum.Panel,
link="quay.io/<YOUR_ORGANIZATION>/YOUR_IMAGE_NAME_HERE:TAG",
recommended_profile="edge.medium"
)
Expand Down
13 changes: 13 additions & 0 deletions Panel/app_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"env_name": "edge-panel-example",
"edm_deps": [
"click",
"pip",
"setuptools"
],
"cmd_deps": [
"docker"
],
"framework": "panel",
"app_id": null
}
14 changes: 9 additions & 5 deletions Panel/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@

import argparse
import subprocess
import json

ENV_NAME = "edge-panel-example"
EDM_DEPS = ["click", "pip", "setuptools"]

with open("app_config.json", "r") as f:
config = json.load(f)
ENV_NAME = config["env_name"]
EDM_DEPS = config["cmd_deps"]


def bootstrap(ci_mode):
Expand All @@ -25,7 +29,7 @@ def bootstrap(ci_mode):
"""

if ENV_NAME not in _list_edm_envs():
print(f"Creating development environment {ENV_NAME}...")
print(f"Creating development environment '{ENV_NAME}'...")
cmd = ["edm", "envs", "create", ENV_NAME, "--version", "3.8", "--force"]
subprocess.run(cmd, check=True)

Expand All @@ -35,10 +39,10 @@ def bootstrap(ci_mode):
print("Bootstrap complete.")

else:
print("Environment already exists; reusing.")
print(f"Environment '{ENV_NAME}' already exists; reusing.")

if not ci_mode:
print(f"Activating dev environment {ENV_NAME}")
print(f"Activating environment '{ENV_NAME}'")
subprocess.run(["edm", "shell", "-e", ENV_NAME])


Expand Down
2 changes: 1 addition & 1 deletion Plotly Dash/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ version = AppVersion(
description="This Is An Example Edge Application",
icon=ICON,
kind=AppKindEnum.Native,
proxy_kind=AppProxyKindEnum.PlotlyDash,
framework=AppProxyKindEnum.PlotlyDash,
link="quay.io/<YOUR_ORGANIZATION>/YOUR_IMAGE_NAME_HERE:TAG",
recommended_profile="edge.medium"
)
Expand Down
13 changes: 13 additions & 0 deletions Plotly Dash/app_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"env_name": "edge-plotly-dash-example",
"edm_deps": [
"click",
"pip",
"setuptools"
],
"cmd_deps": [
"docker"
],
"framework": "plotly-dash",
"app_id": null
}
14 changes: 9 additions & 5 deletions Plotly Dash/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@

import argparse
import subprocess
import json

ENV_NAME = "edge-plotly-dash-example"
EDM_DEPS = ["click", "pip", "setuptools"]

with open("app_config.json", "r") as f:
config = json.load(f)
ENV_NAME = config["env_name"]
EDM_DEPS = config["cmd_deps"]


def bootstrap(ci_mode):
Expand All @@ -25,7 +29,7 @@ def bootstrap(ci_mode):
"""

if ENV_NAME not in _list_edm_envs():
print(f"Creating development environment {ENV_NAME}...")
print(f"Creating development environment '{ENV_NAME}'...")
cmd = ["edm", "envs", "create", ENV_NAME, "--version", "3.8", "--force"]
subprocess.run(cmd, check=True)

Expand All @@ -35,10 +39,10 @@ def bootstrap(ci_mode):
print("Bootstrap complete.")

else:
print("Environment already exists; reusing.")
print(f"Environment '{ENV_NAME}' already exists; reusing.")

if not ci_mode:
print(f"Activating dev environment {ENV_NAME}")
print(f"Activating environment '{ENV_NAME}'")
subprocess.run(["edm", "shell", "-e", ENV_NAME])


Expand Down
2 changes: 1 addition & 1 deletion React/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ version = AppVersion(
description="This Is An Example Edge Application",
icon=ICON,
kind=AppKindEnum.Native,
proxy_kind=AppProxyKindEnum.React,
framework=AppProxyKindEnum.React,
link="quay.io/<YOUR_ORGANIZATION>/YOUR_IMAGE_NAME_HERE:TAG",
recommended_profile="edge.medium"
)
Expand Down
14 changes: 14 additions & 0 deletions React/app_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"env_name": "edge-react-example",
"edm_deps": [
"click",
"gunicorn",
"pip",
"setuptools"
],
"cmd_deps": [
"docker"
],
"framework": "react",
"app_id": null
}
14 changes: 9 additions & 5 deletions React/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@

import argparse
import subprocess
import json

ENV_NAME = "edge-react-example"
EDM_DEPS = ["click", "gunicorn", "pip", "setuptools"]

with open("app_config.json", "r") as f:
config = json.load(f)
ENV_NAME = config["env_name"]
EDM_DEPS = config["cmd_deps"]


def bootstrap(ci_mode):
Expand All @@ -25,7 +29,7 @@ def bootstrap(ci_mode):
"""

if ENV_NAME not in _list_edm_envs():
print(f"Creating development environment {ENV_NAME}...")
print(f"Creating development environment '{ENV_NAME}'...")
cmd = ["edm", "envs", "create", ENV_NAME, "--version", "3.8", "--force"]
subprocess.run(cmd, check=True)

Expand All @@ -35,10 +39,10 @@ def bootstrap(ci_mode):
print("Bootstrap complete.")

else:
print("Environment already exists; reusing.")
print(f"Environment '{ENV_NAME}' already exists; reusing.")

if not ci_mode:
print(f"Activating dev environment {ENV_NAME}")
print(f"Activating environment '{ENV_NAME}'")
subprocess.run(["edm", "shell", "-e", ENV_NAME])


Expand Down
2 changes: 1 addition & 1 deletion Streamlit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ version = AppVersion(
description="This Is An Example Edge Application",
icon=ICON,
kind=AppKindEnum.Native,
proxy_kind=AppProxyKindEnum.Streamlit,
framework=AppProxyKindEnum.Streamlit,
link="quay.io/<YOUR_ORGANIZATION>/YOUR_IMAGE_NAME_HERE:TAG",
recommended_profile="edge.medium"
)
Expand Down
13 changes: 13 additions & 0 deletions Streamlit/app_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"env_name": "edge-streamlit-example",
"edm_deps": [
"click",
"pip",
"setuptools"
],
"cmd_deps": [
"docker"
],
"framework": "streamlit",
"app_id": null
}
14 changes: 9 additions & 5 deletions Streamlit/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@

import argparse
import subprocess
import json

ENV_NAME = "edge-streamlit-example"
EDM_DEPS = ["click", "pip", "setuptools"]

with open("app_config.json", "r") as f:
config = json.load(f)
ENV_NAME = config["env_name"]
EDM_DEPS = config["cmd_deps"]


def bootstrap(ci_mode):
Expand All @@ -25,7 +29,7 @@ def bootstrap(ci_mode):
"""

if ENV_NAME not in _list_edm_envs():
print(f"Creating development environment {ENV_NAME}...")
print(f"Creating development environment '{ENV_NAME}'...")
cmd = ["edm", "envs", "create", ENV_NAME, "--version", "3.8", "--force"]
subprocess.run(cmd, check=True)

Expand All @@ -35,10 +39,10 @@ def bootstrap(ci_mode):
print("Bootstrap complete.")

else:
print("Environment already exists; reusing.")
print(f"Environment '{ENV_NAME}' already exists; reusing.")

if not ci_mode:
print(f"Activating dev environment {ENV_NAME}")
print(f"Activating environment '{ENV_NAME}'")
subprocess.run(["edm", "shell", "-e", ENV_NAME])


Expand Down
Loading