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

Makefile: Add capability to validate individual runtime images #2879

Merged
merged 1 commit into from
Aug 12, 2022

Conversation

ptitzler
Copy link
Member

@ptitzler ptitzler commented Aug 12, 2022

This PR adds a new validate-runtime-image task to the Makefile, which can be used to verify that a given container image meets the minimum requirements for runtime images.

Invocation:

 $ make validate-runtime-image image=<image:tag>

Examples:

  • Invalid invocation

    $ make validate-runtime-image
    Usage: make validate-runtime-image image=<container-image-name>
    make: *** [validate-runtime-image] Error 1
    
  • Invalid container image name

    $ make validate-runtime-image image=no-such-image:tag. 
    ***********************************************************
    Validating container image no-such-image:tag
    -----------------------------------------------------------
    => Loading container image ...
    Container image no-such-image:tag is not present, pulling...
    Error response from daemon: pull access denied for no-such-image, repository does not exist or may 
    require 'docker login': denied: requested access to the resource is denied
    ERROR: pull of container image no-such-image:tag failed
    make: *** [validate-runtime-image] Error 1
    
  • Container image fails validation

    $ make validate-runtime-image image=busybox:stable   
    ***********************************************************
    Validating container image busybox:stable
    -----------------------------------------------------------
    => Loading container image ...
    => Checking container image busybox:stable for curl...
    ERROR: Container image busybox:stable does not meet criteria for command: curl
    => Checking container image busybox:stable for python3...
    ERROR: Container image busybox:stable does not meet criteria for command: python3
    -----------------------------------------------------------
    => ERROR: Container image busybox:stable is not a suitable Elyra runtime image
    make: *** [validate-runtime-image] Error 1
    
  • Container image passes validation

    $ make validate-runtime-image image=amancevice/pandas:1.4.1
    ***********************************************************
    Validating container image amancevice/pandas:1.4.1
    -----------------------------------------------------------
    => Loading container image ...
    => Checking container image amancevice/pandas:1.4.1 for curl...
    => Checking container image amancevice/pandas:1.4.1 for python3...
    => Checking notebook execution...
    Collecting ipykernel==6.13.0
    Downloading ipykernel-6.13.0-py3-none-any.whl (131 kB)
    ...
    -----------------------------------------------------------
    => Container image amancevice/pandas:1.4.1 is a suitable Elyra runtime image
    

Notes:

  • The task is not listed when make (without parameters) is run. Perhaps it should since it's a task Elyra users should perform.

Closes #2774

What changes were proposed in this pull request?

How was this pull request tested?

  • Ran the following:
    • make validate-runtime-images
    • make validate-runtime-image image=no-such-image:tag
    • make validate-runtime-image image=image-that-fails:validation
    • make validate-runtime-image image=image-that-passes:validation

Developer's Certificate of Origin 1.1

   By making a contribution to this project, I certify that:

   (a) The contribution was created in whole or in part by me and I
       have the right to submit it under the Apache License 2.0; or

   (b) The contribution is based upon previous work that, to the best
       of my knowledge, is covered under an appropriate open source
       license and I have the right under that license to submit that
       work with modifications, whether created in whole or in part
       by me, under the same open source license (unless I am
       permitted to submit under a different license), as indicated
       in the file; or

   (c) The contribution was provided directly to me by some other
       person who certified (a), (b) or (c) and I have not modified
       it.

   (d) I understand and agree that this project and the contribution
       are public and that a record of the contribution (including all
       personal information I submit with it, including my sign-off) is
       maintained indefinitely and may be redistributed consistent with
       this project or the open source license(s) involved.

@ptitzler ptitzler added kind:enhancement New feature or request component:build build and build related issues(dependencies and docker) labels Aug 12, 2022
@ptitzler ptitzler added this to the 3.11.0 milestone Aug 12, 2022
@elyra-bot
Copy link

elyra-bot bot commented Aug 12, 2022

Thanks for making a pull request to Elyra!

To try out this branch on binder, follow this link: Binder

@akchinSTC akchinSTC self-requested a review August 12, 2022 15:34
Copy link
Member

@akchinSTC akchinSTC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works as advertised

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:build build and build related issues(dependencies and docker) kind:enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Makefile: support validation of custom runtime images
2 participants