openshift / oc-mirror

Lifecycle manager for internet-disconnected OpenShift environments
Apache License 2.0
88 stars 80 forks source link

Metadata not found #178

Closed SDBrett closed 2 years ago

SDBrett commented 2 years ago

What happened?

The command ./bin/oc-mirror list updates --config imageset-config.yaml --dir test-create --log-level debug returns

DEBUG looking for metadata file at "publish/.metadata.json"
error: no metadata detected

-

What you expected to happen?

List updates

How to reproduce it (as minimally and precisely as possible)?

I'm running through the usage steps on the README.md document.

Anything else we need to know?

imageset-config.yaml

apiVersion: tmp-redhatgov.com/v1alpha1
kind: ImageSetConfiguration
mirror:
  ocp:
    channels:
      - name: stable-4.8
      - name: fast-4.8
      - name: stable-4.9
    graph: true
  operators:
    - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.8
      headsOnly: true
      packages:
        - name: couchbase-operator
          versions:
            - '1.4.0'
        - name: crunchy-postgresql-operator
          channels:
            - name: 'stable'
  additionalimages:
    - name: registry.redhat.io/ubi8/ubi:latest
  blockedimages:
    - name: alpine
    - name: redis 
afflom commented 2 years ago

First off, thank you for trying out oc-mirror.

If there is no metadata available, we would want to dump the output of a dryrun from all of the mirroring functions within the app. The word "update" makes less sense in this context. Perhaps we should just change this to dryrun. Wdyt @jpower432 ?

Unrelated, I have a trimmed down config that might make your evaluation a bit easier. It needs to eventually make it into the repo, but I'll post it here later.

afflom commented 2 years ago

This config might be helpful. It has an example registry backend and demos all of the major sections. Also, when downloading operator catalogs consider using --continue-on-error and/or --skip-missing, due to some images being intermittently unavailable.

apiVersion: tmp-redhatgov.com/v1alpha1
kind: ImageSetConfiguration
storageConfig:
  registry:
    imageURL: localhost:5010/demo/metadata
    skipTLS: true
mirror:
  ocp:
    channels:
      - name: stable-4.9
    graph: true
  operators:
    - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.9
      headsonly: true
  additionalimages:
    - name: registry.redhat.io/ubi8/ubi:latest
    - name: quay.io/podman/stable:latest
  helm:
    repos: 
      - name: podinfo
        url: https://stefanprodan.github.io/podinfo
        charts: 
          - name: podinfo
            version: 5.0.0
jpower432 commented 2 years ago

First off, thank you for trying out oc-mirror.

If there is no metadata available, we would want to dump the output of a dryrun from all of the mirroring functions within the app. The word "update" makes less sense in this context. Perhaps we should just change this to dryrun. Wdyt @jpower432 ?

Unrelated, I have a trimmed down config that might make your evaluation a bit easier. It needs to eventually make it into the repo, but I'll post it here later.

@afflom Maybe it would be better to just change the error message. The point of this command is to run it against an existing workspace to see what new versions there are since the last run. I think perhaps better documentation on this command and a more informative error message may be helpful. I think we could incorporate DryRun into the mirroring command since our libraries already have that capability. Thoughts?

SDBrett commented 2 years ago

Thanks for the info so far, I'm still having trouble getting things started, I've been looking at the test scripts, built and stood up the docker container and run the command ./bin/oc-mirror create full --config imageset-config.yaml --dir ./test-create "file://archive" --source-skip-tls --dest-skip-tls --skip-cleanup --log-level=debug but that gives no output.

Backing up a little bit.... My understanding is that I can use oc-mirror to pull content just as helm charts, operators etc to a location on my local computer. I can then use oc-mirror to publish (push) those images to a registry.

Is my understanding correct?

If the command I'm running is intended to be run against an existing workspace, perhaps oc-mirror init would be a good command for first run.

jpower432 commented 2 years ago

Thanks for the info so far, I'm still having trouble getting things started, I've been looking at the test scripts, built and stood up the docker container and run the command ./bin/oc-mirror create full --config imageset-config.yaml --dir ./test-create "file://archive" --source-skip-tls --dest-skip-tls --skip-cleanup --log-level=debug but that gives no output.

@SDBrett I think the issue here you are using the old UX command (probably a result of our usage docs being out of date, PR to fix is #182 ) To mirror now with main you just need to alter it to be ./bin/oc-mirror --config imageset-config.yaml --dir ./test-create "file://archive" --skip-cleanup --log-level=debug.

Backing up a little bit.... My understanding is that I can use oc-mirror to pull content just as helm charts, operators etc to a location on my local computer. I can then use oc-mirror to publish (push) those images to a registry.

Is my understanding correct?

This is correct. We also support mirror to mirror for partially disconnected environments where you can complete those to stages with one command.

If the command I'm running is intended to be run against an existing workspace, perhaps oc-mirror init would be a good command for the first run.

I think oc-mirror init could work.

SDBrett commented 2 years ago

Thanks @jpower432 !!

The updated command appears to have made the difference. I was able to download the files using the imageset provided by @afflom

SDBrett commented 2 years ago

Closing ticket out as doc updates have been merged