- 
                Notifications
    You must be signed in to change notification settings 
- Fork 83
Publish sample plugin container images #191
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
Conversation
bd40200    to
    1fb47a9      
    Compare
  
    1fb47a9    to
    07381be      
    Compare
  
    | @marquiz This looks pretty good. For me the main remaining question is whether this is useful enough already as such, or if we should consider adding either a sample deployment file or a Helm chart for the built plugins. There are some extra bits from the host containerized plugins need to function, so it could be useful to provide a bit more sugar-coating for the sample plugins. All plugins need access to the NRI socket from the host to be able to run containerized. Additionally some of the plugins need access to extra bits from the host to be able to function. For instance, the  | 
| 
 @marquiz But as we discussed offline, it is probably better to just handle image building with this PR and file a new one for anything else we come up with. | 
| I'm quite keen to follow the development of this effort because I'm affected by the containerd 2.0 reduced limits in GKE. Last night I attempted to deploy a DaemonSet using @marquiz container image for the  Thank you for working on publishing container images and making the discussion public so I can follow it. :-) | 
| @pwhack The reduced limits in GKE should be fixed, I believe starting in 1.33.2-gke.1043000. It looks like we need to update the docs to supply that version. I'll take a look. | 
ba397a6    to
    4fb8690      
    Compare
  
    | Reading the comments I split this into multiple PRs. Let's handle image building/publishing here and the other bits elsewhere for (hopefully) easier review: 
 @klihub's #192 is required to be merged before this one (or otherwise the image building fails) | 
| #192 is merged.. | 
4fb8690    to
    be27676      
    Compare
  
    | Rebased. s/reference plugin/sample plugin/ in PR description and commit messages. | 
| 
 @pwhack The plugins need at least a bind-mounted NRI socket so they can register themselves to the runtime. Some, for instance the hook injector need a bit more. I tested yesterday with the test-built image from @marquiz fork and this was enough to get it up and running. For others, the socket mount alone should be enough. apiVersion: v1
kind: Pod
metadata:
  name: oci-hook-injector
  #namespace: kube-system
spec:
  containers:
  - name: oci-hook-injector
    image: ghcr.io/marquiz/nri/plugins/hook-injector:unstable
    imagePullPolicy: IfNotPresent
    args:
      - -idx
      - "10"
    resources:
      requests:
        cpu: 250m
        memory: 100M
      limits:
        cpu: 250m
        memory: 100M
    volumeMounts:
    - name: nri-socket
      mountPath: /var/run/nri
    - name: oci-hooks-config
      mountPath: /etc/containers/oci/hooks.d
    - name: oci-hooks-binaries
      mountPath: /usr/local/sbin
  volumes:
  - name: nri-socket
    hostPath:
      path: /var/run/nri
      type: DirectoryOrCreate
  - name: oci-hooks-config
    hostPath:
      path: /etc/containers/oci/hooks.d
      type: DirectoryOrCreate
  - name: oci-hooks-binaries
    hostPath:
      path: /usr/local/sbin
      type: DirectoryOrCreate
  terminationGracePeriodSeconds: 1We agreed with @marquiz that we'll add in further PRs something more to show how to get them up and running, for instance sample daemonset files for the plugins. | 
be27676    to
    4bfb8ed      
    Compare
  
    Add a generic dockerfile for building container images of the sample plugins. The build command creates statically linked binaries and the resulting images are minimal, based on scratch base image. Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
4bfb8ed    to
    5f32e38      
    Compare
  
    | Updated: 
 | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| Updated: added CI check to test build images on PRs | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvm looks like it's already requesting multi-arch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Publish multiarch container images of the sample plugins at ghcr.io/containerd/nri/plugins/<plugin>:<tag> The tag is the git tag name for tagged versions and "unstable" for the main branch. The default-validator and wasm plugins are skipped in the config. The default-validator plugin is not runnable as an external plugin and the wasm plugin cannot be run from a container. Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
Only test build on amd64 to make the test builds fast. Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
fcc9376    to
    fc7d649      
    Compare
  
    
This is a minimal PR for enabling building and pushing container images for the sample plugins.
Contains two parts:
Add Dockerfile for building images
Add a generic dockerfile for building container images of the sample plugins. The build command creates statically linked binaries and the resulting images are minimal, based on scratch base image.
Add github workflow for publishing container images
Publish multiarch container images of the sample plugins at ghcr.io/containerd/nri/plugins/:.
The tag is the git tag name for tagged versions and "unstable" for the main branch.
The default-validator and wasm plugins are skipped in the config. The default-validator plugin is not runnable as an external plugin and the wasm plugin cannot be run from a container.
Refs #190
NOTE: workflow tested in my personal repo https://github.com/marquiz?tab=packages&repo_name=nri