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
3 changes: 2 additions & 1 deletion veadk/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import typer
import uvicorn

from veadk.cli.studio.fast_api import get_fast_api_app
from veadk.utils.logger import get_logger
from veadk.version import VERSION

Expand Down Expand Up @@ -153,6 +152,8 @@ def web(
def studio(
path: str = typer.Option(".", "--path", help="Project path"),
):
from veadk.cli.studio.fast_api import get_fast_api_app

path = Path(path).resolve()

agent_py_path = os.path.join(path, "agent.py")
Expand Down
40 changes: 4 additions & 36 deletions veadk/cli/services/vefaas/vefaas.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import importlib.util
import json
import time

Expand All @@ -28,7 +27,6 @@
)

from veadk.cli.services.veapig.apig import APIGateway
from veadk.config import veadk_environments
from veadk.utils.logger import get_logger
from veadk.utils.misc import formatted_timestamp
from veadk.utils.volcengine_sign import ve_request
Expand Down Expand Up @@ -60,36 +58,6 @@ def __init__(self, access_key: str, secret_key: str, region: str = "cn-beijing")

self.template_id = "6874f3360bdbc40008ecf8c7"

def _pre_check(self, path: str):
if not path.exists():
raise ValueError(f"Path {path} does not exist.")

index_py_path = path / "index.py"
if not index_py_path.exists():
raise ValueError(
"The project directory must include the `index.py` file. See: https://www.volcengine.com/docs/6662/107432"
)
typer.echo(
typer.style(
"Check `index.py` file pass.",
fg=typer.colors.BRIGHT_BLACK,
),
)

spec = importlib.util.spec_from_file_location("index", index_py_path)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
if not (hasattr(module, "handler") and callable(module.handler)):
raise ValueError(
"The `index.py` file must include a `handler` function. See: https://www.volcengine.com/docs/6662/107432"
)
typer.echo(
typer.style(
"Check `handler` function pass.",
fg=typer.colors.BRIGHT_BLACK,
),
)

def _create_function(self, name: str, path: str):
function_name = f"{name}-fn-{formatted_timestamp()}"

Expand All @@ -99,7 +67,10 @@ def _create_function(self, name: str, path: str):
)

envs = []
for key, value in veadk_environments.items():

import veadk.config

for key, value in veadk.config.veadk_environments.items():
envs.append(EnvForCreateFunctionInput(key=key, value=value))
typer.echo(
typer.style(
Expand Down Expand Up @@ -166,9 +137,6 @@ def _create_function(self, name: str, path: str):

return function_name, function_id

def _get_template(self):
pass

def _create_application(
self,
application_name: str,
Expand Down
2 changes: 1 addition & 1 deletion veadk/cli/studio/web/404.html

Large diffs are not rendered by default.

This file was deleted.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion veadk/cli/studio/web/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion veadk/cli/studio/web/index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
:HL["/_next/static/media/569ce4b8f30dc480-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
:HL["/_next/static/media/93f479601ee12b01-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
:HL["/_next/static/css/366cfdd7fdd8bcac.css","style"]
0:{"P":null,"b":"psspzzoILImmFjgieicga","p":"","c":["",""],"i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/366cfdd7fdd8bcac.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__variable_5cfdac __variable_9a8899 antialiased flex flex-col min-h-dvh max-h-dvh w-full","children":[["$","div",null,{"className":"flex w-full","children":["$","header",null,{"className":"px-4 md:px-6 w-full","children":["$","div",null,{"className":"flex h-16 items-center justify-between gap-4","children":[["$","div",null,{"className":"flex flex-1 items-center gap-2","children":[["$","$L2",null,{"children":[["$","$L3",null,{"asChild":true,"children":["$","button",null,{"data-slot":"button","className":"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50 group size-8 md:hidden","children":["$","svg",null,{"className":"pointer-events-none","width":16,"height":16,"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round","xmlns":"http://www.w3.org/2000/svg","children":[["$","path",null,{"d":"M4 12L20 12","className":"origin-center -translate-y-[7px] transition-all duration-300 ease-[cubic-bezier(.5,.85,.25,1.1)] group-aria-expanded:translate-x-0 group-aria-expanded:translate-y-0 group-aria-expanded:rotate-[315deg]"}],["$","path",null,{"d":"M4 12H20","className":"origin-center transition-all duration-300 ease-[cubic-bezier(.5,.85,.25,1.8)] group-aria-expanded:rotate-45"}],["$","path",null,{"d":"M4 12H20","className":"origin-center translate-y-[7px] transition-all duration-300 ease-[cubic-bezier(.5,.85,.25,1.1)] group-aria-expanded:translate-y-0 group-aria-expanded:rotate-[135deg]"}]]}]}]}],["$","$L4",null,{"align":"start","className":"w-36 p-1 md:hidden","children":["$","$L5",null,{"data-slot":"navigation-menu","data-viewport":true,"className":"group/navigation-menu relative flex flex-1 items-center justify-center max-w-none *:w-full","children":[["$","$L6",null,{"data-slot":"navigation-menu-list","className":"group flex flex-1 list-none justify-center flex-col items-start gap-0 md:gap-2","children":[[["$","$L7","0",{"data-slot":"navigation-menu-item","className":"relative w-full","children":["$","$L8",null,{"data-slot":"navigation-menu-link","className":"data-[active]:focus:bg-accent data-[active]:hover:bg-accent data-[active]:bg-accent data-[active]:text-accent-foreground hover:bg-accent focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4 py-1.5","href":"https://volcengine.github.io/veadk-python/","target":"_blank","children":"Documents"}]}],["$","$L7","1",{"data-slot":"navigation-menu-item","className":"relative w-full","children":["$","$L8",null,{"data-slot":"navigation-menu-link","className":"data-[active]:focus:bg-accent data-[active]:hover:bg-accent data-[active]:bg-accent data-[active]:text-accent-foreground hover:bg-accent focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4 py-1.5","href":"/","target":"_blank","children":"Studio"}]}]],"$L9","$La","$Lb"]}],"$Lc"]}]}]]}],"$Ld"]}],"$Le"]}]}]}],"$Lf","$L10"]}]}]]}],{"children":["__PAGE__","$L11",{},null,false]},null,false],"$L12",false]],"m":"$undefined","G":["$13",[]],"s":false,"S":true}
0:{"P":null,"b":"CAa-wD_dU_yJ-FVDcKvQG","p":"","c":["",""],"i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/366cfdd7fdd8bcac.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__variable_5cfdac __variable_9a8899 antialiased flex flex-col min-h-dvh max-h-dvh w-full","children":[["$","div",null,{"className":"flex w-full","children":["$","header",null,{"className":"px-4 md:px-6 w-full","children":["$","div",null,{"className":"flex h-16 items-center justify-between gap-4","children":[["$","div",null,{"className":"flex flex-1 items-center gap-2","children":[["$","$L2",null,{"children":[["$","$L3",null,{"asChild":true,"children":["$","button",null,{"data-slot":"button","className":"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50 group size-8 md:hidden","children":["$","svg",null,{"className":"pointer-events-none","width":16,"height":16,"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round","xmlns":"http://www.w3.org/2000/svg","children":[["$","path",null,{"d":"M4 12L20 12","className":"origin-center -translate-y-[7px] transition-all duration-300 ease-[cubic-bezier(.5,.85,.25,1.1)] group-aria-expanded:translate-x-0 group-aria-expanded:translate-y-0 group-aria-expanded:rotate-[315deg]"}],["$","path",null,{"d":"M4 12H20","className":"origin-center transition-all duration-300 ease-[cubic-bezier(.5,.85,.25,1.8)] group-aria-expanded:rotate-45"}],["$","path",null,{"d":"M4 12H20","className":"origin-center translate-y-[7px] transition-all duration-300 ease-[cubic-bezier(.5,.85,.25,1.1)] group-aria-expanded:translate-y-0 group-aria-expanded:rotate-[135deg]"}]]}]}]}],["$","$L4",null,{"align":"start","className":"w-36 p-1 md:hidden","children":["$","$L5",null,{"data-slot":"navigation-menu","data-viewport":true,"className":"group/navigation-menu relative flex flex-1 items-center justify-center max-w-none *:w-full","children":[["$","$L6",null,{"data-slot":"navigation-menu-list","className":"group flex flex-1 list-none justify-center flex-col items-start gap-0 md:gap-2","children":[[["$","$L7","0",{"data-slot":"navigation-menu-item","className":"relative w-full","children":["$","$L8",null,{"data-slot":"navigation-menu-link","className":"data-[active]:focus:bg-accent data-[active]:hover:bg-accent data-[active]:bg-accent data-[active]:text-accent-foreground hover:bg-accent focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4 py-1.5","href":"https://volcengine.github.io/veadk-python/","target":"_blank","children":"Documents"}]}],["$","$L7","1",{"data-slot":"navigation-menu-item","className":"relative w-full","children":["$","$L8",null,{"data-slot":"navigation-menu-link","className":"data-[active]:focus:bg-accent data-[active]:hover:bg-accent data-[active]:bg-accent data-[active]:text-accent-foreground hover:bg-accent focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4 py-1.5","href":"/","target":"_blank","children":"Studio"}]}]],"$L9","$La","$Lb"]}],"$Lc"]}]}]]}],"$Ld"]}],"$Le"]}]}]}],"$Lf","$L10"]}]}]]}],{"children":["__PAGE__","$L11",{},null,false]},null,false],"$L12",false]],"m":"$undefined","G":["$13",[]],"s":false,"S":true}
14:I[61223,["527","static/chunks/527-1c65afbb202752bd.js","4357","static/chunks/4357-39eb6b5934ac97db.js","261","static/chunks/261-19b52c2c85aefb5d.js","7177","static/chunks/app/layout-b0d50d105c55fd6d.js"],"Viewport"]
15:I[92945,["527","static/chunks/527-1c65afbb202752bd.js","4357","static/chunks/4357-39eb6b5934ac97db.js","261","static/chunks/261-19b52c2c85aefb5d.js","7177","static/chunks/app/layout-b0d50d105c55fd6d.js"],"GithubIcon"]
16:I[17885,["527","static/chunks/527-1c65afbb202752bd.js","4357","static/chunks/4357-39eb6b5934ac97db.js","261","static/chunks/261-19b52c2c85aefb5d.js","7177","static/chunks/app/layout-b0d50d105c55fd6d.js"],"default"]
Expand Down
2 changes: 1 addition & 1 deletion veadk/cli/studio/web/run.html

Large diffs are not rendered by default.

Loading