Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build pack images that don't also have s2i builders when s2i is the default #1492

Closed
tvand opened this issue Jan 11, 2023 · 13 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@tvand
Copy link

tvand commented Jan 11, 2023

According to the Release Notes, Openshift Serverless Operator 1.26 comes with kn 1.5.0 and kn func plugin 1.8.1.

With these versions
kn func create --language node
creates a func.yaml that uses a different specification version (previous was 0.25.0):

specVersion: 0.34.0
name: kn-1-5-0
runtime: node
registry: ""
image: ""
imageDigest: ""
created: 2023-01-11T16:41:50.0787175+01:00
invocation:
  format: http
build:
  buildpacks: []
  builder: ""
  buildEnvs: []
run:
  volumes: []
  envs: []
deploy:
  namespace: ""
  annotations: {}
  options: {}
  labels: []
  healthEndpoints:
    liveness: /health/liveness
    readiness: /health/readiness

This format is not covered by the reference documentation AFAICS.

Where can I find the current documentation?

@lance
Copy link
Member

lance commented Jan 12, 2023

@tvand thanks for pointing out the documentation needs updating! Until that happens, you can see the schema for the current func.yaml here https://github.com/knative/func/blob/main/schema/func_yaml-schema.json

@lkingland
Copy link
Member

Also perhaps worth noting is that the func.yaml of existing functions will be automatically migrated forward.

@tvand
Copy link
Author

tvand commented Jan 16, 2023

Do you have a working example we can start from?
kn func deploy does not accept builder: pack and keeps rewriting it to builder: s2i.

@lance
Copy link
Member

lance commented Jan 16, 2023

Hi @tvand I don't think this answers your question about the builder field, but wanted to share it anyway for completeness. In the example below, I have a function project created with func v1.7.1 and you can see the func.yaml contents. I then build the function using a newer version func v1.8.1 and the func.yaml file is automatically upgraded.

bat func.yaml
───────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: func.yaml
───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ specVersion: 0.25.0
   2   │ name: test-func
   3   │ namespace: ""
   4   │ runtime: node
   5   │ registry: ""
   6   │ image: ""
   7   │ imageDigest: ""
   8   │ buildpacks: []
   9   │ builder: ""
  10   │ volumes: []
  11   │ buildEnvs: []
  12   │ envs: []
  13   │ annotations: {}
  14   │ options: {}
  15   │ labels: []
  16   │ healthEndpoints:
  17   │   liveness: /health/liveness
  18   │   readiness: /health/readiness
  19   │ created: 2023-01-16T15:48:18.506635-05:00
  20   │ invocation:
  21   │   format: http
───────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
func build
   🙌 Function image built: quay.io/lanceball/test-func:latest
bat func.yaml
───────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: func.yaml
───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ specVersion: 0.34.0
   2   │ name: test-func
   3   │ runtime: node
   4   │ registry: quay.io/lanceball
   5   │ image: quay.io/lanceball/test-func:latest
   6   │ imageDigest: ""
   7   │ created: 2023-01-16T15:48:18.506635-05:00
   8   │ invocation:
   9   │   format: http
  10   │ build:
  11   │   buildpacks: []
  12   │   builder: pack
  13   │   buildEnvs: []
  14   │ run:
  15   │   volumes: []
  16   │   envs: []
  17   │ deploy:
  18   │   namespace: ""
  19   │   annotations: {}
  20   │   options: {}
  21   │   labels: []
  22   │   healthEndpoints:
  23   │     liveness: /health/liveness
  24   │     readiness: /health/readiness
───────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Can you try building once with the existing values in func.yaml using func v1.8.1, then modify the build: builder: field?

@tvand
Copy link
Author

tvand commented Jan 20, 2023

I'll try to show what happens (Disclaimer: this is not my own serverless test, so bear with me if something is incomplete)

This is the working example before upgrade. It has been created with kn 1.3.1 (where deployment works fine)
150_test_func_yaml_vorher

Then we try to deploy it with kn 1.5.0 which fails:
serverless-kn-cli-150-deploy-error-spec025

Now the func. yaml looks like this:
150_test_func_yaml_nachher

See the line builder: s2i in the file. If we change this to builder: pack and run kn 1.5.0 again, we get the same error message and the field is reset to builder: s2i in the file. We reverted to kn 1.3.1 for now but we would like to understand how to actually resolve this.

@lance
Copy link
Member

lance commented Jan 20, 2023

@tvand can you provide a link to the project?

@lance
Copy link
Member

lance commented Jan 20, 2023

See the line builder: s2i in the file. If we change this to builder: pack and run kn 1.5.0 again, we get the same error message and the field is reset to builder: s2i in the file. We reverted to kn 1.3.1 for now but we would like to understand how to actually resolve this.

Hmm - I am not able to reproduce this issue using the upstream binaries. I think it might have something to do with the changes we make in midstream to default builds to s2i. I will look into this.

@lance
Copy link
Member

lance commented Jan 20, 2023

See the line builder: s2i in the file. If we change this to builder: pack and run kn 1.5.0 again, we get the same error message and the field is reset to builder: s2i in the file. We reverted to kn 1.3.1 for now but we would like to understand how to actually resolve this.

Confirmed that I can reproduce this issue using downstream kn func.

/kind bug

@knative-prow knative-prow bot added the kind/bug Categorizes issue or PR as related to a bug. label Jan 20, 2023
@lance
Copy link
Member

lance commented Jan 20, 2023

@tvand instead of modifying func.yaml directly, can you please try building with 1.5 using the command line flag?

kn func build --builder pack

@lance lance changed the title Where is func.yaml specVersion 0.34.0 documented? Unable to build pack images that don't also have s2i builders when s2i is the default Jan 23, 2023
@tvand
Copy link
Author

tvand commented Jan 24, 2023

Unfortunately, I cannot provide a link to the project as it is internally hosted. I'll try the suggested command line flag, however.

@lance
Copy link
Member

lance commented Jan 24, 2023

@tvand I believe this is fixed in #1519 however you won't see it in the downstream product until Serverless 1.29, expected release date April 25.

@lance lance self-assigned this Feb 21, 2023
@github-actions
Copy link
Contributor

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 23, 2023
@lance
Copy link
Member

lance commented May 23, 2023

Closing this as resolved in both upstream and downstream. @tvand please reopen or create a new issue if you encounter this again.

@lance lance closed this as completed May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
Archived in project
Development

No branches or pull requests

3 participants