Skip to content

Commit

Permalink
refactor: and add .dockerignore
Browse files Browse the repository at this point in the history
  • Loading branch information
tekumara committed Jul 10, 2022
1 parent 57eb14b commit 7ee8b85
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 12 deletions.
23 changes: 23 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.dockerignore
Dockerfile
.git/
.github/
.gitignore
.pre-commit-config.yaml
*.md
.idea/
.vscode/
*.code-workspace
*.iml
.pytest_cache/
__pycache__/
.mypy_cache/
*.egg-info
build/
dist/
.DS_Store
typings/
.tox/
pip-wheel-metadata/
node_modules/
.venv/
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ kubes-prefect: $(venv)
while : ; do curl -fsS http://localhost:4200/ > /dev/null && break; sleep 1; done
$(venv)/bin/prefect work-queue create kubernetes

## show logs
logs:
kubectl logs -lapp=orion --all-containers

## access orion.db in kubes
kubes-db:
kubectl exec -i -t svc/orion -c=api -- /bin/bash -c 'hash sqlite3 || (apt-get update && apt-get install sqlite3) && sqlite3 ~/.prefect/orion.db'

## run basic_flow
basic-flow: $(venv)
$(venv)/bin/python -m flows.basic_flow
Expand Down Expand Up @@ -68,6 +60,14 @@ kubes-flow: $(venv)
ui: $(venv)
PATH="$(venv)/bin:$$PATH" prefect orion start

## show logs
logs:
kubectl logs -lapp=orion --all-containers

## access orion.db in kubes
kubes-db:
kubectl exec -i -t svc/orion -c=api -- /bin/bash -c 'hash sqlite3 || (apt-get update && apt-get install sqlite3) && sqlite3 ~/.prefect/orion.db'

## upgrade to latest vesion of orion
upgrade: $(venv)
latest=$$($(venv)/bin/pip index versions prefect --pre | grep 'LATEST' | sed -E 's/[[:space:]]+LATEST:[[:space:]]+([^[:space:]]+).*/\1/') && \
Expand Down
6 changes: 3 additions & 3 deletions flows/kubes_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def kubes_flow() -> None:
),
)

# use the FilePackager to store the flow's source file in S3
# use the FilePackager to store the flow's source file in S3 using fsspec
Deployment(
name="kubes-deployment-file-packager",
flow=kubes_flow,
Expand All @@ -38,8 +38,8 @@ def kubes_flow() -> None:
packager=FilePackager(filesystem=RemoteFileSystem(basepath="s3://minio-flows/")),
)

# use the default OrionPackager to store the flow's import path as a block in the database.
# The flow is already stored inside the docker image and so can be imported.
# use the OrionPackager with the ImportSerializer to store the flow's import path
# as a JSON block in the database, for import at runtime from inside the docker image.
Deployment(
name="kubes-deployment-orion-packager-import",
flow=kubes_flow,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"devDependencies": {
"pyright": "1.1.201"
"pyright": "1.1.258"
}
}

0 comments on commit 7ee8b85

Please sign in to comment.