shy-evening-51366
06/30/2023, 12:46 PMflytectl demo start --dev
), and was able to make compile
and test all the different components. Now on the final step when running flyte start --config flyte_local.yaml
it fails, due to wanting to access /home/{user}/.flyte/k3s/k3s.yaml
which is a broken symlink (as described here as well: https://github.com/flyteorg/flyte/issues/3645)
❯ flyte start --config flyte_local.yaml
INFO[0000] Using config file: [flyte_local.yaml]
{"json":{"src":"viper.go:398"},"level":"debug","msg":"Config section [plugins] updated. No update handler registered.","ts":"2023-06-30T14:39:46+02:00"}
...
{"json":{"src":"viper.go:398"},"level":"debug","msg":"Config section [webhook] updated. No update handler registered.","ts":"2023-06-30T14:39:46+02:00"}
{"json":{"src":"start.go:63"},"level":"info","msg":"Running Database Migrations...","ts":"2023-06-30T14:39:46+02:00"}
{"json":{"src":"start.go:124"},"level":"error","msg":"Failed to create controller manager. error building Kubernetes Clientset: Error building kubeconfig: stat /home/user/.flyte/k3s/k3s.yaml: no such file or directory","ts":"2023-06-30T14:39:46+02:00"}
{"json":{"src":"start.go:185"},"level":"panic","msg":"Failed to start Propeller, err: error building Kubernetes Clientset: Error building kubeconfig: stat /home/user/.flyte/k3s/k3s.yaml: no such file or directory","ts":"2023-06-30T14:39:46+02:00"}
panic: (*logrus.Entry) 0xc000510380
goroutine 61 [running]:
<http://github.com/sirupsen/logrus.(*Entry).log(0xc000510310|github.com/sirupsen/logrus.(*Entry).log(0xc000510310>, 0x0, {0xc0014de0a0, 0x9f})
/root/go/pkg/mod/github.com/sirupsen/logrus@v1.8.1/entry.go:259 +0x487
<http://github.com/sirupsen/logrus.(*Entry).Log(0xc000510310|github.com/sirupsen/logrus.(*Entry).Log(0xc000510310>, 0x0, {0xc00105be68?, 0x1?, 0x1?})
/root/go/pkg/mod/github.com/sirupsen/logrus@v1.8.1/entry.go:293 +0x4f
<http://github.com/sirupsen/logrus.(*Entry).Logf(0xc000510310|github.com/sirupsen/logrus.(*Entry).Logf(0xc000510310>, 0x0, {0x3145be9?, 0x0?}, {0xc000a8e230?, 0x0?, 0x0?})
/root/go/pkg/mod/github.com/sirupsen/logrus@v1.8.1/entry.go:338 +0x85
<http://github.com/sirupsen/logrus.(*Entry).Panicf(0x3fdac40|github.com/sirupsen/logrus.(*Entry).Panicf(0x3fdac40>?, {0x3145be9?, 0x416947?}, {0xc000a8e230?, 0x2a74b80?, 0x1?})
/root/go/pkg/mod/github.com/sirupsen/logrus@v1.8.1/entry.go:376 +0x34
<http://github.com/flyteorg/flytestdlib/logger.Panicf({0x3fdac40|github.com/flyteorg/flytestdlib/logger.Panicf({0x3fdac40>?, 0xc000c55310?}, {0x3145be9, 0x22}, {0xc000a8e230, 0x1, 0x1})
/root/go/pkg/mod/github.com/flyteorg/flytestdlib@v1.0.17/logger/logger.go:188 +0x64
<http://github.com/flyteorg/flyte/cmd/single.glob..func4.2()|github.com/flyteorg/flyte/cmd/single.glob..func4.2()>
/home/user/git/flyte/flyte/cmd/single/start.go:185 +0xbe
<http://golang.org/x/sync/errgroup.(*Group).Go.func1()|golang.org/x/sync/errgroup.(*Group).Go.func1()>
/root/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64
created by <http://golang.org/x/sync/errgroup.(*Group).Go|golang.org/x/sync/errgroup.(*Group).Go>
/root/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5
shy-evening-51366
06/30/2023, 12:50 PMflyte start --config flyte-single-binary-local.yaml
shy-evening-51366
06/30/2023, 12:54 PM$HOME/.flyte/cluster-resource-templates
later on which does not exist in my environmentshy-evening-51366
06/30/2023, 1:21 PM$HOME/.flyte/webhook-certs
shy-evening-51366
06/30/2023, 1:31 PMkubectl get secret -n flyte flyte-pod-webhook -o json | jq -r '.data."ca.crt"' | base64 -d > ~/.flyte/webhook-certs/ca.crt
) but no luck:
{
"json": {
"src": "start.go:185"
},
"level": "panic",
"msg": "Failed to start Propeller, err: mkdir $HOME/.flyte/webhook-certs: no such file or directory",
"ts": "2023-06-30T15:29:15+02:00"
}
shy-evening-51366
06/30/2023, 2:36 PM./webhook-certs
instead (certs are created in local directory), but it feels very wonkyshy-evening-51366
06/30/2023, 2:54 PMWorkflow[flytesnacks:development:example.training_workflow] failed. RuntimeExecutionError: max number of system retry attempts [11/10] exhausted. Last known status message: failed at Node[n0]. RuntimeExecutionError: failed during plugin execution, caused by: failed to execute handle for plugin [container]: [InternalError] failed to create resource, caused by: Internal error occurred: failed calling webhook "<http://flyte-pod-webhook.flyte.org|flyte-pod-webhook.flyte.org>": failed to call webhook: Post "<https://flyte-sandbox-local.all.svc:9443/mutate--v1-pod?timeout=10s>": service "flyte-sandbox-local" not found
acceptable-window-92672
06/30/2023, 4:44 PMflyte_local.yaml
in https://github.com/flyteorg/flyte/pull/3808. It has not been merged yet. (It is mentioned in doc, But I will highlight it further)shy-evening-51366
06/30/2023, 4:54 PMacceptable-window-92672
06/30/2023, 4:54 PMshy-evening-51366
06/30/2023, 8:13 PM@task(
secret_requests=[
Secret(
group="user-info",
key="user_secret",
mount_requirement=Secret.MountType.ENV_VAR,
)
]
)
def test() -> bool:
print(os.environ)
context = flytekit.current_context()
secret_val = context.secrets.get("user-info", "user_secret")
print(secret_val)
return True
gives:
Unable to find secret for key user_secret in group user-info in Env Var:_FSEC_USER-INFO_USER_SECRET and FilePath: /etc/secrets/user-info/user_secret
The secret is there in K8s cluster (in the correct namespace). Same code works fine in normal demo environmentacceptable-window-92672
06/30/2023, 10:28 PMflytectl demo start
, the task will success.
with flytectl demo start --dev
and flyte start --config flyte_local.yaml
, the task does failed.
Currently not sure why... looking at it.acceptable-window-92672
06/30/2023, 11:49 PMflyte_local.yaml
, we disable the webhook.
propeller:
disableWebhook: true
acceptable-window-92672
07/01/2023, 4:01 AMfailed to call webhook
error.
flytectl demo start --dev
git clone <https://github.com/flyteorg/flyte.git>
cd flyte
go mod tidy
sudo make compile
flyte start --config flyte_local.yaml
# The flyte_local.yaml I used is this one(which I think I have set webhook correctly):
# This is a sample configuration file.
# Real configuration when running inside K8s (local or otherwise) lives in a ConfigMap
# Look in the artifacts directory in the flyte repo for what's actually run
# <https://github.com/lyft/flyte/blob/b47565c9998cde32b0b5f995981e3f3c990fa7cd/artifacts/flyteadmin.yaml#L72>
# Flyte clusters can be run locally with this configuration
# flytectl demo start --dev
# flyte start --config flyte_local.yaml
propeller:
rawoutput-prefix: "<s3://my-s3-bucket/test/>"
kube-config: "$HOME/.flyte/sandbox/kubeconfig"
create-flyteworkflow-crd: true
webhook:
certDir: ./webhook-certs
secretName: flyte-sandbox-webhook-secret
serviceName: flyte-sandbox-local
localCert: true
servicePort: 9443
tasks:
task-plugins:
enabled-plugins:
- container
- sidecar
- K8S-ARRAY
default-for-task-types:
- container: container
- container_array: K8S-ARRAY
server:
kube-config: "$HOME/.flyte/sandbox/kubeconfig"
flyteadmin:
runScheduler: false
database:
postgres:
port: 30001
username: postgres
password: postgres
host: localhost
dbname: flyteadmin
options: "sslmode=disable"
storage:
type: minio
connection:
access-key: minio
auth-type: accesskey
secret-key: miniostorage
disable-ssl: true
endpoint: "<http://localhost:30002>"
region: my-region
cache:
max_size_mbs: 10
target_gc_percent: 100
container: "my-s3-bucket"
Logger:
show-source: true
level: 5
admin:
endpoint: localhost:8089
insecure: true
plugins:
# All k8s plugins default configuration
k8s:
inject-finalizer: true
default-env-vars:
- AWS_METADATA_SERVICE_TIMEOUT: 5
- AWS_METADATA_SERVICE_NUM_ATTEMPTS: 20
- FLYTE_AWS_ENDPOINT: "<http://flyte-sandbox-minio.flyte:9000>"
- FLYTE_AWS_ACCESS_KEY_ID: minio
- FLYTE_AWS_SECRET_ACCESS_KEY: miniostorage
# Logging configuration
logs:
kubernetes-enabled: true
kubernetes-template-uri: <http://localhost:30080/kubernetes-dashboard/#/log/{{.namespace> }}/{{ .podName }}/pod?namespace={{ .namespace }}
cluster_resources:
refreshInterval: 5m
templatePath: "/etc/flyte/clusterresource/templates"
# -- Starts the cluster resource manager in standalone mode with requisite auth credentials to call flyteadmin service endpoints
standaloneDeployment: false
customData:
- production:
- projectQuotaCpu:
value: "8"
- projectQuotaMemory:
value: "16Gi"
- staging:
- projectQuotaCpu:
value: "8"
- projectQuotaMemory:
value: "16Gi"
- development:
- projectQuotaCpu:
value: "8"
- projectQuotaMemory:
value: "16Gi"
refresh: 5m
flyte:
admin:
disableClusterResourceManager: true
disableScheduler: true
propeller:
disableWebhook: false
task_resources:
defaults:
cpu: 500m
memory: 1Gi
limits:
cpu: 2
memory: 4Gi
gpu: 5
catalog-cache:
endpoint: localhost:8081
insecure: true
type: datacatalog
freezing-boots-56761
POD_NAMESPACE=flyte flyte start --config flyte_local.yaml
to get it to work with webhookfreezing-boots-56761
acceptable-window-92672
07/01/2023, 4:05 AMacceptable-window-92672
07/01/2023, 4:23 AMUnable to find secret for key user_secret in group user-info in Env Var:_FSEC_USER-INFO_USER_SECRET and FilePath: /etc/secrets/user-info/user_secret
Not sure if this is same with the issue here: https://github.com/flyteorg/flyte/issues/2260freezing-boots-56761
acceptable-window-92672
07/01/2023, 4:27 AMfreezing-boots-56761
freezing-boots-56761
acceptable-window-92672
07/01/2023, 4:30 AM- name: ovzwk3rnnfxgm216
secret:
defaultMode: 420
items:
- key: user_secret
path: user_secret
optional: true
secretName: user-info
But still get
Unable to find secret for key user_secret in group user-info in Env Var:_FSEC_USER-INFO_USER_SECRET and FilePath: /etc/flyte/secrets/user-info/user_secret
freezing-boots-56761
freezing-boots-56761
-
might be throwing if offacceptable-window-92672
07/01/2023, 4:32 AMacceptable-window-92672
07/01/2023, 4:32 AMacceptable-window-92672
07/01/2023, 4:33 AMfreezing-boots-56761
acceptable-window-92672
07/01/2023, 4:34 AMacceptable-window-92672
07/01/2023, 4:34 AMfreezing-boots-56761
freezing-boots-56761
acceptable-window-92672
07/01/2023, 4:35 AMflytectl demo start
works just fineacceptable-window-92672
07/01/2023, 4:35 AMfreezing-boots-56761
user-info
works in flytectl demo start
but not flytectl demo start --dev
?acceptable-window-92672
07/01/2023, 4:37 AMfreezing-boots-56761
freezing-boots-56761
acceptable-window-92672
07/01/2023, 4:37 AMfreezing-boots-56761
freezing-boots-56761
make cmd/single/dist
POD_NAMESPACE=flyte go run -tags console cmd/main.go start --config ~/.flyte/flyte-single-binary-local.yaml
acceptable-window-92672
07/01/2023, 4:47 AMmake cmd/single/dist
does. Could I just run POD_NAMESPACE=flyte flyte start --config ~/.flyte/flyte-single-binary-local.yaml
freezing-boots-56761
make cmd/single/dist
is to update the flyteconsole distfreezing-boots-56761
freezing-boots-56761
acceptable-window-92672
07/01/2023, 4:51 AMacceptable-window-92672
07/01/2023, 5:13 AMacceptable-window-92672
07/01/2023, 5:14 AMfreezing-boots-56761
freezing-boots-56761
freezing-boots-56761
acceptable-window-92672
07/01/2023, 5:18 AMacceptable-window-92672
07/01/2023, 5:18 AMacceptable-window-92672
07/01/2023, 5:19 AMshy-evening-51366
07/01/2023, 7:16 AMPOD_NAMESPACE=flyte go run -tags console cmd/main.go start --config ~/.flyte/flyte-single-binary-local.yaml
did the trick. Now have a dev environment where I can see my changes 😄 Thank you both so much!freezing-boots-56761