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
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.venv
Dockerfile
.git
.vscode
.github
__pycache__
*.pyc
*.pyo
*.pyd
dist
31 changes: 31 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy

on:
push:
branches: [ "main" ]

permissions:
contents: read

jobs:
deploy:
environment: website-prod
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Azure login
uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Install Azure CLI
uses: pietrobolcato/install-azure-cli-action@main

- name: Run Deploy.ps1
shell: pwsh
run: ./Deploy.ps1 `
-resourceGroupName ${{ secrets.AZURE_RESOURCE_GROUP }} `
-appName ${{ secrets.AZURE_APP_NAME }} `
-acrName ${{ secrets.AZURE_ACR_NAME }}
28 changes: 28 additions & 0 deletions Deploy.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
param(
[Parameter(Mandatory)]
[string] $resourceGroupName,

[Parameter(Mandatory)]
[string] $appName,

[Parameter(Mandatory)]
[string] $acrName
)

$imageName = "uipath-dev-python:$(Get-Date -Format 'yyyyMMddHHmmss')"
$acrImageName = "$($acrName).azurecr.io/$($imageName)"

az acr login --name $acrName

docker build -t $imageName $PSScriptRoot
docker tag $imageName $acrImageName
docker push $acrImageName

az webapp config container set `
--resource-group $resourceGroupName `
--name $appName `
--container-image-name $acrImageName

az webapp restart `
--resource-group $resourceGroupName `
--name $appName
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:3.11.14-bookworm

WORKDIR /app

RUN curl -LsSf https://astral.sh/uv/install.sh | sh
COPY . /app/

RUN chmod +x start.sh

ENV UIPATH_DEV_SERVER_PORT=80
ENV UIPATH_DEV_SERVER_HOST=0.0.0.0

CMD ["/bin/sh", "/app/start.sh"]
4 changes: 2 additions & 2 deletions src/uipath/dev/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def __init__(
self,
runtime_factory: UiPathRuntimeFactoryProtocol,
trace_manager: UiPathTraceManager,
host: str = "localhost",
port: int = 8000,
host: str = os.environ.get("UIPATH_DEV_SERVER_HOST", "localhost"),
port: int = int(os.environ.get("UIPATH_DEV_SERVER_PORT", "8080")),
open_browser: bool = True,
factory_creator: Callable[[], UiPathRuntimeFactoryProtocol] | None = None,
) -> None:
Expand Down
5 changes: 5 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# !/bin/sh
/root/.local/bin/uv venv --clear
. ./.venv/bin/activate
/root/.local/bin/uv sync
/root/.local/bin/uv run uipath-dev-server