hey trying to use `ImageSpec` on the hello world e...
# ask-the-community
h
hey trying to use
ImageSpec
on the hello world example. the hello world file:
Copy code
from flytekit import ImageSpec, task, workflow

image = ImageSpec(
    name="imagespec",
    registry="localhost:30000",
    packages=["smart-open[gcs]"],
    apt_packages=["git"],
)

@task(container_image=image)
def say_hello() -> str:
    return "hello world"

@workflow
def my_wf() -> str:
    return say_hello()
I am running the demo sandbox and executed this
Copy code
cd ~/projects/flytesnacks/examples/basics
flytectl demo start
envd context use --name flyte-sandbox
Using the right context I think:
Copy code
❯ envd context ls                      
CONTEXT                	BUILDER         	BUILDER ADDR                     	RUNNER	RUNNER ADDR 
default                	docker-container	<docker-container://envd_buildkitd>	docker	           	
flyte-sandbox (current)	tcp             	<tcp://localhost:30003>            	docker
Getting this error:
Copy code
❯ pyflyte run --remote basics/hello_world.py my_wf
Image localhost:30000/imagespec:smnRYWZ9xTB4xFoEmprU_Q.. not found. Building...
Run command: envd build --path /tmp/flyte-7hnhtddt/sandbox/local_flytekit/9759c0608f0326822a33edc8a8603f11  --platform linux/amd64 --output type=image,name=localhost:30000/imagespec:smnRYWZ9xTB4xFoEmprU_Q..,push=true 
Failed with Unknown Exception <class 'Exception'> Reason: failed to run command envd build --path /tmp/flyte-7hnhtddt/sandbox/local_flytekit/9759c0608f0326822a33edc8a8603f11  --platform linux/amd64 --output type=image,name=localhost:30000/imagespec:smnRYWZ9xTB4xFoEmprU_Q..,push=true with error b'error: timeout 5s: cannot connect to buildkitd\n'
failed to run command envd build --path /tmp/flyte-7hnhtddt/sandbox/local_flytekit/9759c0608f0326822a33edc8a8603f11  --platform linux/amd64 --output type=image,name=localhost:30000/imagespec:smnRYWZ9xTB4xFoEmprU_Q..,push=true with error b'error: timeout 5s: cannot connect to buildkitd\n'
k
is builtkit deployment running
you can check it by running
kubectl get pods -n flyte
Copy code
registry="localhost:30000
should use 30003 here
h
Hey @Kevin Su changing to 30003 didn't solve it
Copy code
❯ kubectl get pods -n flyte
NAME                                                  READY   STATUS    RESTARTS   AGE
flyte-sandbox-kubernetes-dashboard-6757db879c-8kbm2   1/1     Running   0          72s
flyte-sandbox-proxy-d95874857-zlc2k                   1/1     Running   0          72s
flyte-sandbox-docker-registry-67b7b67664-89zlh        1/1     Running   0          72s
flyte-sandbox-minio-645c8ddf7c-mj6dt                  1/1     Running   0          72s
flyte-sandbox-postgresql-0                            1/1     Running   0          73s
flyte-sandbox-98749fb56-p5dc6                         1/1     Running   0          72s
doesn't seem like the builtkit is running - how can I start this
@Kevin Su wondering if you had an idea how to resolve this
k
cc @jeev did we add buildkit deployment to the latest sandbox image?
j
@Kevin Su: unreleased
Copy code
flytectl demo start --image=<http://ghcr.io/flyteorg/flyte-sandbox-bundled:sha-713f3f86a4d74d555e1a55b52065119df39117e3|ghcr.io/flyteorg/flyte-sandbox-bundled:sha-713f3f86a4d74d555e1a55b52065119df39117e3>
to use the latest nightly image
Copy code
> kubectl get po -A
NAMESPACE     NAME                                                  READY   STATUS    RESTARTS      AGE
flyte         flyte-sandbox-postgresql-0                            1/1     Running   0             59s
flyte         flyte-sandbox-proxy-d95874857-6l52x                   1/1     Running   0             59s
kube-system   local-path-provisioner-7b7dc8d6f5-sjlfr               1/1     Running   0             59s
flyte         flyte-sandbox-docker-registry-5876748b9c-tg482        1/1     Running   0             59s
kube-system   coredns-b96499967-rv99h                               1/1     Running   0             59s
flyte         flyte-sandbox-kubernetes-dashboard-6757db879c-smvr6   1/1     Running   0             59s
flyte         flyte-sandbox-minio-645c8ddf7c-2tv64                  1/1     Running   0             59s
flyte         flyte-sandbox-buildkit-7d7d55dbb-mgpk6                1/1     Running   0             59s
kube-system   metrics-server-668d979685-nv7r9                       1/1     Running   0             59s
flyte         flyte-sandbox-98749fb56-xxq9n                         1/1     Running   1 (37s ago)   59s
or whatever
flyteorg/flyte
commit after the buildkit commit went in
format is
Copy code
flytectl demo start --image=<http://ghcr.io/flyteorg/flyte-sandbox-bundled:sha-<LONG_COMMIT|ghcr.io/flyteorg/flyte-sandbox-bundled:sha-<LONG_COMMIT>>
h
works !