Hiya, me again with another Prefect question! We a...
# ask-community
p
Hiya, me again with another Prefect question! We are moving our apply of deployment yamls to a github action. It seems to try and run, but we get an error that says "did not conform to deployment spec: JSONDecodeError('Expecting value: line 1 column 1 (char 0)')" but when I run this same file with a deployment apply on a local test server it works fine so doesnt seem to be the yaml itself? Any help would be much appreciated!
n
hey @Paige Fuller - iirc you were using
flow.from_source(...).deploy(...)
, have you switched to
prefect deploy
+
prefect.yaml
?
p
I couldn't get people to switch to flow from source so we are instead defining yamls for each deployment and then uploading them with prefect deployment apply on each yaml from GHA
n
prefect deployment apply
ooh yeah I would use
prefect deploy
+
prefect.yaml
instead of
prefect deployment apply
+
deployment.yaml
- agents / block-based deployments have been deprecated for a bit and we recommend workers here's the agents to workers guide tldr, • a work pool has all the config an infra block does, it serves as the base template that many deployments can override •
prefect agent start
->
prefect worker start
prefect.yaml
is more or less the same structure as
deployment.yaml
(pst just run
prefect init
in a new repo and follow the CLI!) • you dont need storage blocks for deployments with workers, you just need a
pull
step to tell the worker where to get the code at runtime, like a
git_clone
step (again, select
docker-git
after running
prefect init
🙂 ) as for the issue you meantioned, that seems like what you get when you try to read an empty JSON file. are you sure your CI is looking at the right thing?
p
It seems like the CI is actually getting the JSON error from not getting a proper response from the server - is there a clear way to authenticate to our self hosted server? Could just be an auth issue?
n
if you're running a server yourself an auth issue wouldn't be related to prefect itself, unless you've written some auth for it - OSS server has no auth implemented by default
103 Views