Skip to content

Commit

Permalink
Change shell scripts to run new UI
Browse files Browse the repository at this point in the history
  • Loading branch information
msalihaltun committed Jun 30, 2024
1 parent 27da621 commit 6dbf443
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,4 @@ postgres-data

## Frontend
node_modules
.env.backup
4 changes: 2 additions & 2 deletions run_ui.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
source "$(poetry env info --path)/bin/activate"
streamlit run streamlit_app/visualizer/streamlit.py -- $@
cd skyvern-frontend
npm run start
18 changes: 17 additions & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ command_exists() {

ensure_required_commands() {
# Ensure required commands are available
for cmd in poetry; do
for cmd in poetry npm; do
if ! command_exists "$cmd"; then
echo "Error: $cmd is not installed." >&2
exit 1
Expand Down Expand Up @@ -165,6 +165,11 @@ choose_python_version_or_fail() {
# Function to install dependencies
install_dependencies() {
poetry install
echo "Installing frontend dependencies"
cd skyvern-frontend
npm run --silent install
cd ..
echo "Frontend dependencies installed."
}

activate_poetry_env() {
Expand Down Expand Up @@ -255,9 +260,20 @@ create_organization() {
echo "Existing secrets.toml file backed up as secrets.backup.toml"
fi

# Check if secrets.toml exists and back it up
if [ -f "skyvern-frontend/.env" ]; then
cp skyvern-frontend/.env skyvern-frontend/.env.backup
echo "Skyvern Frontend - existing .env file backed up as .env.backup"
fi

# Update the secrets-open-source.toml file
echo -e "[skyvern]\nconfigs = [\n {\"env\" = \"local\", \"host\" = \"http://127.0.0.1:8000/api/v1\", \"orgs\" = [{name=\"Skyvern\", cred=\"$api_token\"}]}\n]" > .streamlit/secrets.toml
echo ".streamlit/secrets.toml file updated with organization details."

cp skyvern-frontend/.env.example skyvern-frontend/.env
echo "skyvern-frontend/.env file created."
sed -i '' -e "s/YOUR_API_KEY/$api_token/g" skyvern-frontend/.env
echo "skyvern-frontend/.env file updated with API token."
}

# Main function
Expand Down
2 changes: 1 addition & 1 deletion skyvern-frontend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ VITE_ARTIFACT_API_BASE_URL=http://localhost:9090
VITE_WSS_BASE_URL=ws://localhost:8000/api/v1

# your api key - for x-api-key header
VITE_SKYVERN_API_KEY=
VITE_SKYVERN_API_KEY=YOUR_API_KEY

0 comments on commit 6dbf443

Please sign in to comment.