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

Add script to regenerate catalog_upload.json files #200

Conversation

ckadner
Copy link
Member

@ckadner ckadner commented Sep 2, 2021

It is becoming difficult to maintain the catalog upload files for the Bootstrapper and the Quickstart with Docker Compose.

This PR adds a helper script to regenerate the catalog_upload.json file(s) from the YAML files that are found inside the cloned katalog repo.

$ python3 hack/regenerate_catalog_upload_json.py 

Regenerating catalog_upload.json files:
 - bootstrapper/catalog_upload.json
 - quickstart/catalog_upload.json

Done. Use git diff to evaluate if and which changes are desired!

Current caveats:

  • no documentation yet
  • no command parameters, no command line help
  • the user must have cloned the katalog repo and the mlx repo in the same parent folder (in the future those paths should be configurable as parameters)
  • not all of the YAML files in the katalog repo may want to be included in the catalog upload, so after the files get regenerated, the user (MLX maintainer) needs to excercise some judgment
  • assets that live outside the katalog repo will not be found and have to be re-added (or not removed) using a Git enabled IDE or git diff tool
  • this initial commit reorders some of the assets (based on filename)

Verify all URLs are valid:

grep -o -h -E "http.*yaml" */catalog_upload.json | \
  while read url; do \
    curl -s -o /dev/null -w "%{http_code}" $url; echo ": ${url}"; \
  done | grep --color "404"

Signed-off-by: Christian Kadner [email protected]

@ckadner ckadner self-assigned this Sep 2, 2021
@mlx-bot mlx-bot requested a review from yhwang September 2, 2021 08:29
@mlx-bot
Copy link
Collaborator

mlx-bot commented Sep 2, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ckadner

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ckadner ckadner changed the title Add script to regenerate catalog_upload.json files Add script to regenerate catalog_upload.json files Sep 2, 2021
Add helper script to regenerate the catalog_upload.json
file(s) from the *.yaml files that are found inside the
locally cloned katalog repo.

Regenerate files:
- bootstrapper/catalog_upload.json
- quickstart/catalog_upload.json

Current caveats:
- no documentation yet
- no command parameters, no command line help
- the user must have cloned the katalog repo and the mlx
  repo in the same parent folder (in the future those paths
  should be configurable as parameters)
- not all of the YAML files in the katalog repo may want
  to be included in the catalog upload, so after the files
  get regenerated, the user (MLX maintainer) needs to
  exercise some judgment
- assets that live outside the katalog repo will not be
  found and have to be re-added (or not removed) using a
  Git enabled IDE or git diff tool
- this initial commit reorders some of the assets (based
  on filename)

Signed-off-by: Christian Kadner <[email protected]>
@ckadner ckadner force-pushed the add_script_to_regenerate_catalog_upload_json_files branch from 22886ea to 9201347 Compare September 2, 2021 09:30
@ckadner ckadner force-pushed the add_script_to_regenerate_catalog_upload_json_files branch from 15244ad to 14a1b51 Compare September 23, 2021 19:49
@ckadner ckadner marked this pull request as ready for review September 23, 2021 19:51
@ckadner
Copy link
Member Author

ckadner commented Sep 23, 2021

@Tomcli -- this PR adds the new katalog assets for CodeNet, Qiskit and MAX models.

It will also help to take care of future katalog updates with a new script.

@ckadner ckadner requested review from Tomcli and removed request for Tomcli and yhwang September 23, 2021 19:58
@Tomcli
Copy link
Member

Tomcli commented Sep 23, 2021

/lgtm

@mlx-bot mlx-bot added the lgtm label Sep 23, 2021
@mlx-bot mlx-bot merged commit 3129492 into machine-learning-exchange:main Sep 23, 2021
@ckadner
Copy link
Member Author

ckadner commented Sep 23, 2021

Thanks @Tomcli

@ckadner
Copy link
Member Author

ckadner commented Sep 23, 2021

I will address (some of) the current caveats listed above in a separate PR: #222

  • move script from /hack to /tools/python
  • add developer documentation
  • clone the katalog repo into a temp directory instead of relying on the user to have done it prior to running the script
  • not all of the YAML files in the katalog repo may want to be included in the catalog upload, so alert the user to all the changes instead of relying on git diff
  • read the catalog_upload.json file prior to regenerating it, in order to capture assets that live outside the katalog repo and re-add them later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants