redhat-buildpacks / testing

Project aiming to help us to perform e2e tests using Buildpacks
Apache License 2.0
0 stars 3 forks source link

shipwright pod fails during execution of step : build-an-push #53

Closed cmoulliard closed 4 months ago

cmoulliard commented 4 months ago

Issue

The shipwright pod fails during execution of a buildpack step: build-an-push

Paketo UBI Java Helper Buildpack 0.1.0
  open /bpi.paketo.ubi.java.version: no such file or directory
ERROR: failed to build: exit status 1
Stream closed EOF for default/buildpack-quarkus-buildrun-wnrck-dnsks-pod (step-build-and-push)

This error is reported by the following java buildpack:

// https://github.com/paketo-community/ubi-java-buildpack/blob/main/build.go#L24
const javaVersionBuilderFile = "/bpi.paketo.ubi.java.version"
const javaHelpersBuilderFile = "/bpi.paketo.ubi.java.helpers"
const openSslLoaderName = "openssl-certificate-loader"

func Build(context libcnb.BuildContext) (libcnb.BuildResult, error) {
    result := libcnb.BuildResult{}

    logger := log.NewPaketoLogger(os.Stdout)
    logger.Title(context.Buildpack.Info.Name, context.Buildpack.Info.Version, context.Buildpack.Info.Homepage)

    //read the env vars set via the extension.
    versionb, err := os.ReadFile(javaVersionBuilderFile)
    if err != nil {
        return result, err
    }

Versions:

Shipwright: 0.11
Tekton: v0.56.4
ubi builder image: paketocommunity/builder-ubi-base:0.0.54

Shipwright has been installed on a kind cluster and build created using the following resources: https://github.com/redhat-buildpacks/testing/tree/617bcbec9af7551b4995760bfbb962c2aa5916cf/k8s/shipwright/unsecured

Pod YAML: https://gist.github.com/cmoulliard/0795233fe6c87d225cf85b9c3e6c8765

cmoulliard commented 4 months ago

The error repiorted was due to a wrong image passed to the lifecyle. This is fixed

cmoulliard commented 4 months ago

We are nevertheless getting a new error:

ERROR: stat /kaniko: no such file or directory
Stream closed EOF for default/buildpack-quarkus-buildrun-55qpt-5dlxf-pod (step-extender)
cmoulliard commented 4 months ago

ERROR: stat /kaniko: no such file or directory

Fixed after adding the missing volume mounting: /kaniko

cmoulliard commented 4 months ago

hmhmh. We got now this error may be because we don't specify the output image name correctly

Starting extender...
Parsing inputs...
Ensuring privileges...
Executing command...
ERROR: failed to extend build image: getting build image to extend: failed to get digest for reference '': a digest must contain exactly one '@' separator (e.g. registry/repository@digest) saw:
Stream closed EOF for default/buildpack-quarkus-buildrun-fsnvj-5wtw5-pod (step-extender)

Idea about the cause of this error ? @BarDweller

cmoulliard commented 4 months ago

ERROR: failed to extend build image:

Fixed as the shipwright restore step was missing the build-image param:

    - name: restore
      image: $(params.CNB_BUILDER_IMAGE)
      imagePullPolicy: Always
      command: ["/cnb/lifecycle/restorer"]
      args:
        - "-log-level=$(params.CNB_LOG_LEVEL)"
        - "-build-image=$(params.CNB_BUILD_IMAGE)"