-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Yicheng-Lu-llll <[email protected]>
- Loading branch information
1 parent
2239968
commit 31104aa
Showing
3 changed files
with
47 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,9 @@ | ||
ARG PYTHON_VERSION | ||
FROM python:${PYTHON_VERSION}-slim-buster | ||
|
||
MAINTAINER Flyte Team <[email protected]> | ||
LABEL org.opencontainers.image.source https://github.com/flyteorg/flytekit | ||
|
||
FROM python:3.9-slim-buster | ||
USER root | ||
WORKDIR /root | ||
ENV PYTHONPATH /root | ||
|
||
ARG VERSION | ||
ARG DOCKER_IMAGE | ||
|
||
RUN apt-get update && apt-get install build-essential -y | ||
|
||
# Pod tasks should be exposed in the default image | ||
RUN pip install -U flytekit==$VERSION \ | ||
flytekitplugins-pod==$VERSION \ | ||
flytekitplugins-deck-standard==$VERSION \ | ||
flytekitplugins-envd==$VERSION \ | ||
scikit-learn | ||
|
||
RUN useradd -u 1000 flytekit | ||
RUN chown flytekit: /root | ||
USER flytekit | ||
|
||
ENV FLYTE_INTERNAL_IMAGE "$DOCKER_IMAGE" | ||
RUN apt-get install git -y | ||
RUN pip install -U git+https://github.com/Yicheng-Lu-llll/flytekit.git@"visualization#egg=flytekitplugins-deck-standard&subdirectory=plugins/flytekit-deck-standard" | ||
RUN pip install -U git+https://github.com/Yicheng-Lu-llll/flytekit.git@real-time-deck-support | ||
ENV FLYTE_INTERNAL_IMAGE "localhost:30000/flytekit:demo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Step1: Ensure you have pushed your changes to the remote repo | ||
# In the flytekit folder | ||
git add . && git commit -s -m "develop" && git push | ||
|
||
# Step2: Build the image | ||
# In the flytekit folder | ||
export FLYTE_INTERNAL_IMAGE="localhost:30000/flytekit:demo" | ||
docker build --no-cache -t "${FLYTE_INTERNAL_IMAGE}" -f ./Dockerfile . | ||
|
||
# Step3: Push the image to the Flyte Cluster | ||
docker push ${FLYTE_INTERNAL_IMAGE} | ||
|
||
# Step4: Submit a hello world workflow to the Flyte Cluster | ||
|
||
pyflyte run --image ${FLYTE_INTERNAL_IMAGE} --remote ./test.py wf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import flytekit | ||
from flytekit import Resources, task, workflow | ||
from flytekit.core.utils import timeit | ||
|
||
@task( | ||
disable_deck=False, | ||
limits=Resources(mem="4Gi", cpu="1"), | ||
) | ||
def t1(): | ||
import time | ||
|
||
for i in range(2): | ||
# timeit measure the time used in the block and shown in time line deck. See https://github.com/flyteorg/flytekit/pull/1581. | ||
# Or you can add information to your own deck. See https://docs.flyte.org/projects/cookbook/en/latest/auto/core/flyte_basics/deck.html. | ||
with timeit(f"iteration {i}"): | ||
time.sleep(50) | ||
flytekit.Deck.persist() | ||
|
||
|
||
@workflow | ||
def wf(): | ||
t1() | ||
|
||
|
||
if __name__ == "__main__": | ||
wf() |