snowflakedb/snowflake-cli

SNOW-930428: New YAML validator is blocking valid specs in snow snowpark service create

Closed this issue · 4 comments

SnowCLI version

2.0.0-dev

Python version

Python 3.10.11

Platform

macOS-10.16-x86_64-i386-64bit

What happened

After installing from git using
pip install --upgrade snowflake-cli-labs git+https://github.com/snowflake-labs/snowcli

  1. The command snow snowpark services create returns
    "Exception message:
    StrictYAML can only read a string of valid YAML."
    The spec is valid, manually uploading it to a stage and creating a service works.

  2. Why can't I specify a stage anymore? Where is the spec file going?

Console output

Exception message:
StrictYAML can only read a string of valid YAML.

How to reproduce

This is my file but I believe any spec will fail

spec:
containers:
- name: cloudbeaver
image: /spcs_demos_db/cloudbeaver_demo/spcs_repo/cloudbeaver:23.2.1

Thanks, there's indeed and error added in #409 and not detected by test due to mocking.

@sfc-gh-turbaszek 1.1.1 is better, but now this YAML is invalid

spec:
  containers:
    - name: cloudbeaver
      image: /spcs_demos_db/cloudbeaver_demo/spcs_repo/cloudbeaver:23.2.1
  endpoints:
    - name: cloudbeaver
      port: 80
      public: true

I'm getting "Invalid spec: invalid 'endpoints[0].port'. Must be a(n) integer." which its coming from Snowflake, not the validator.

This is the SQL, I think you can see the problem :)

CREATE SERVICE IF NOT EXISTS CLOUDBEAVER_DEMO_SVC
IN COMPUTE POOL SPCS_DEMOS_CP_STANDARD_1
FROM SPECIFICATION '
{"spec": {"containers": [{"name": "cloudbeaver", "image": "/spcs_demos_db/cloudbeaver_demo/spcs_repo/cloudbeaver:23.2.1"}], "endpoints": [{"name": "cloudbeaver", "port": "80", "public": "true"}]}}
'
WITH
MIN_INSTANCES = 1
MAX_INSTANCES = 1

Should be good now on main brach. We will cp this change to 1.1.1rc2