GitHub action code for VMware Image Builder (VIB).

Overview

VMware Image Builder

Overview

This GitHub Action allows to interact with the VMware Image Builder service from VMware, a.k.a. VIB. VIB is a SaaS service that can be used to Package, Verify and Publish software from Internet Software Vendors. This software can be packaged in different formats like for example Carvel Packages or Helm Charts.

One of the strongest capabilities of VIB is being able to verify simultaneously your software in multiple Kubernetes distributions and flavours. Currently VIB does support verification in TKG (different versions), GKE, AKS, EKS and IKS with plans to support even more K8s distributions.

Requirements

Before using this Action you need to have a valid API Token. Valid tokens can be obtained by signing up to VMware Cloud Services and following this instructions.

Once you have a valid api token you will need to set that API token as a repository secret. Your workflow then needs to make that secret available as an environment variable to the GitHub Action.

Usage

Once you have a valid token exposed as secret, ten using the GitHub Action is very simple. Here below you can find what would be a totally valid GitHub workflow that is using this action:

name: 'vib'
on:
  pull_request
env:
  CSP_API_URL: https://console.cloud.vmware.com
  CSP_API_TOKEN: ${{ secrets.CSP_API_TOKEN }}
  VIB_PUBLIC_URL: https://cp.bromelia.vmware.com
jobs:
  validation:
    name: Validate
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: vmware-labs/vmware-image-builder-action@main

Action Input Parameters

The above line is using the GitHub Action default input parameters. You can customize those parameters if you need to, and in fact this will be pretty common when you have multiple pipelines that need to be sent to VIB:

  • config: This is the default folder where the action can find the configuration files for the different tasks that will be executed as part of the pipeline. The default value is .vib.
  • pipeline: This is the default JSON file that contains the VIB pipeline that will be executed. The default value is vib-pipeline.json.

With that in mind, you can customize your action as follows:

    steps:
      - uses: actions/checkout@v2
      - uses: vmware-labs/vmware-image-builder-action@main
        with:
          config: redis-chart-tests
          pipeline: vib-platform-verify.json

Templating your pipelines via environment variables

Pipelines can be templated via environment variables to allow further customization. Any environment variable that your workflow defines with the VIB_ENV_ prefix will be substituted by the GitHub Action in the pipeline file before being sent to VIB. Furthermore, the GitHub Action will make this substitution independently of whether you are using the VIB_ENV_ prefix in your pipeline or not.

For example, if you had the following step:

    steps:
      - uses: vmware-labs/vmware-image-builder-action@main
        env:
          VIB_ENV_PATH: /bitnami/redis

and part of your pipeline looks like:

{
  "phases": {
    "package": {
      "context": {
        "resources": {
          "path": "{PATH}"
        }
      }
    }
  }        
}

The GitHub Action will find the {PATH} template variable and will substitute it with the value from the VIB_ENV_PATH environment variable resulting in the following snipped being used when sending the pipeline to VIB:

{
  "phases": {
    "package": {
      "context": {
        "resources": {
          "path": "/bitnami/redis"
        }
      }
    }
  }        
}

VIB_ENV variable substitution can be a powerful mechanism to make your workloads more flexible and to reuse pipelines.

Special variables

There are a number of special variables that can be used as shortcuts. Here we will keep a list of those

  • {SHA_ARCHIVE}: Points to the HEAD of the change that has triggered the workflow, either from the main branch or a pull request.

Contributing

The vmware-image-builder-action project team welcomes contributions from the community. Before you start working with vmware-image-builder-action, please read our Developer Certificate of Origin. All contributions to this repository must be signed as described on that page. Your signature certifies that you wrote the patch or have the right to pass it on as an open-source patch. For more detailed information, refer to CONTRIBUTING.md.

License

VMware Image Builder Action Copyright 2021 VMware, Inc.

The BSD-2 license (the "License") set forth below applies to all parts of the VMware Image Builder Examples project. You may not use this file except in compliance with the License.

BSD-2 License

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Comments
  • Reordering GitHub Action logs

    Reordering GitHub Action logs

    Right now, we show the log messages in three blocks:

    1. Validation and execution of the pipeline
    2. Uploading of artifacts (aka archiving the produced output)
    3. Summary

    I think it is more explicit and concise this order:

    1. Validation and execution of the pipeline
    2. Summary
    3. Uploading of artifacts (aka archiving the produced output)
    opened by gdelgadot 5
  • Update @actions/core and minimatch

    Update @actions/core and minimatch

    Signed-off-by: Fran Mulero [email protected]

    Description of the change

    Update @actions/core to avoid set-output warnings. https://github.com/actions/toolkit/pull/1178 Update eslint to update minimatch dependency and fix CVE-2022-3517

    Additional information

    Follow up #97 (that PR couldn't read repository configuration becase it was created from fork)

    opened by fmulero 3
  • Add some DNS debugging and random load balancing

    Add some DNS debugging and random load balancing

    Troubleshooting here some server-side connection drops. This adds some debug information on the IPs that are being used. Also randomizes (probably unnecessary) the IP address used.

    dco-required 
    opened by mpermar 3
  • Add dist-check workflow

    Add dist-check workflow

    Signed-off-by: Fran Mulero [email protected]

    Description of the change

    Follow the same approach as in https://github.com/actions/ with the dist folder. Users has to maintain that folder and the workflow checks the content

    Additional information

    Execution example: https://github.com/fmulero/vmware-image-builder-action/pull/1

    opened by fmulero 2
  • Reordering logs in GitHub Action

    Reordering logs in GitHub Action

    Right now, we show the log messages in three blocks:

    1. Validation and execution of the pipeline
    2. Uploading of artifacts (aka archiving the produced output)
    3. Summary

    I think it is more explicit and concise this order:

    1. Validation and execution of the pipeline
    2. Summary
    3. Uploading of artifacts (aka archiving the produced output)

    In addition, we update the nomenclature of some logs terms to make easier the logs reading:

    • execution graph -> pipeline
    • SHA_ARCHIVE -> Resources

    Signed-off-by: Gloria Delgado [email protected]

    opened by gdelgadot 2
  • Fail Github Action workflow on template miss

    Fail Github Action workflow on template miss

    If there are template variables on pipelines and these don't get substituted then the GitHub Action should fail.

    Template variables have the form of {VARIABLE} and the GitHub Action tries to replace those with the values of environment variables with the preffix VIB_ENV_ plus the name of the variable. When we submit a pipeline to Content Platform and the pipeline has any of these variables unsubstituted then the chances of failure are very high and troubleshooting it can be complicated.

    dco-required 
    opened by mpermar 2
  • Update @actions/core and minimatch

    Update @actions/core and minimatch

    Signed-off-by: Fran Mulero [email protected]

    Description of the change

    Update @actions/core to avoid set-output warnings. https://github.com/actions/toolkit/pull/1178 Update minimatch to fix CVE-2022-3517

    opened by fmulero 1
  • Bump @actions/core from 1.6.0 to 1.9.1

    Bump @actions/core from 1.6.0 to 1.9.1

    Bumps @actions/core from 1.6.0 to 1.9.1.

    Changelog

    Sourced from @​actions/core's changelog.

    1.9.1

    • Randomize delimiter when calling core.exportVariable

    1.9.0

    • Added toPosixPath, toWin32Path and toPlatformPath utilities #1102

    1.8.2

    • Update to v2.0.1 of @actions/http-client #1087

    1.8.1

    • Update to v2.0.0 of @actions/http-client

    1.8.0

    1.7.0

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Artifact name improvement

    Artifact name improvement

    The name of the artifact will include the first 8 digits of execution-graph-id. Example: "assets-test-job-TKG-fdcd2674"

    Signed-off-by: mauraza [email protected]

    opened by Mauraza 1
  • Fixing logic to not show actions with no

    Fixing logic to not show actions with no "passed" field in the final summary

    Currently the GitHub Action is showing successful actions as failed because those actions have no passed field. From now on, those actions will not be shown in the final summary.

    Signed-off-by: Gloria Delgado [email protected]

    opened by gdelgadot 1
  • Check if the trigger event has repository information

    Check if the trigger event has repository information

    Some github events, like the schedule one, doesn't have information about the repository in the event definition, causing the following error:

    /home/runner/work/_actions/vmware-labs/vmware-image-builder-action/main/webpack:/vmware-image-builder-action/lib/main.js:23
        return new (P || (P = Promise))(function (resolve, reject) {
    ^
    TypeError: Cannot read properties of undefined (reading 'url')
        at /home/runner/work/_actions/vmware-labs/vmware-image-builder-action/main/webpack:/vmware-image-builder-action/lib/main.js:710:1
        at Generator.next (<anonymous>)
        at /home/runner/work/_actions/vmware-labs/vmware-image-builder-action/main/webpack:/vmware-image-builder-action/lib/main.js:27:1
        at new Promise (<anonymous>)
        at __webpack_modules__.3109.__awaiter (/home/runner/work/_actions/vmware-labs/vmware-image-builder-action/main/webpack:/vmware-image-builder-action/lib/main.js:23:1)
        at loadConfig (/home/runner/work/_actions/vmware-labs/vmware-image-builder-action/main/webpack:/vmware-image-builder-action/lib/main.js:697:1)
        at /home/runner/work/_actions/vmware-labs/vmware-image-builder-action/main/webpack:/vmware-image-builder-action/lib/main.js:95:1
        at Generator.next (<anonymous>)
        at /home/runner/work/_actions/vmware-labs/vmware-image-builder-action/main/webpack:/vmware-image-builder-action/lib/main.js:27:1
        at new Promise (<anonymous>)
    

    Signed-off-by: Fran Mulero [email protected]

    opened by fmulero 1
Releases(0.4.0)
  • 0.4.0(Aug 22, 2022)

    This release again focuses on improvements and fixes but adds a considerable revamp to the action logs with drastically increases usability.

    New features:

    • Action will honor Retry-After headers for increased resiliency and will retry submitting pipelines when instructed so.
    • Scheduled jobs can now be triggers for this GitHub Action.
    • Show a warning to the user when the VMware CSP token is about to expire.

    Improvements and fixes:

    • Decreased log verbosity and improved readability. Debug logs still contain all information.
    • Support retries on ECONNREFUSED errors.
    • Use ref environment variable as the source of truth for fetching tarball.
    • Add support for triggers from scheduled jobs.
    • Add support for SKIPPED pipelines.
    • Fail Github Action workflow on template miss.
    • Action will now display the request error code and message when getting an HTTP error response.
    • Support separate assets for multiple run-attempts on the same GitHub workflow run.
    • Better formatting for action inputs on GitHub Action README file.
    • Error messages from pipeline validation failures are now visible to the users.
    • A new hash is added to asset names to fix naming collisions when running on multiple platforms.

    Welcome @Mauraza and @fmulero as new committers 🙇🎉

    Source code(tar.gz)
    Source code(zip)
  • 0.3.0(Jun 9, 2022)

    New features:

    • Upload logs/reports only for failed actions. By default, artifacts will only be generated for those actions that have failed. This behavior can be customized with the new only-upload-on-failure input parameter.
    • Customizable retries and exponential backoff. A new set of parameters (retry-count and backoff-intervals) now allow to fine tune the resilience capabilities against errors from the VMware Image Builder backend.

    You can find all the default values and configuration items on this section.

    Source code(tar.gz)
    Source code(zip)
  • 0.2.0(Apr 27, 2022)

    New features:

    • Prettified the log output for easier troubleshooting and feedback.
    • Pipelines are now validated before being submitted to VMware Image Builder platform.
    • It is now possible to choose whether logs and reports should be upload or not as GitHub artifacts.

    Improvements and fixes:

    • Display test output on failures.
    • Display failed task errors on failures.
    • Reworked log and report downloading.
    • Specific User-Agent set.
    Source code(tar.gz)
    Source code(zip)
  • 0.1.0(Feb 18, 2022)

    Initial release for VMware Image Builder GitHub action.

    This GitHub Action allows to interact with the VMware Image Builder service from VMware, a.k.a. VIB. VIB is a SaaS service that can be used to Package, Verify and Publish software from Internet Software Vendors. This software can be packaged in different formats like for example Carvel Packages or Helm Charts.

    One of the strongest capabilities of VIB is being able to verify simultaneously your software in multiple Kubernetes distributions and flavours. Currently, VIB does support verification in TKG (different versions), GKE, AKS, EKS and IKS with plans to support even more K8s distributions.

    Check out our README for more information and instruction on how to use this action.

    Source code(tar.gz)
    Source code(zip)
Owner
VMware Labs
This organization contains experimental open source projects.
VMware  Labs
Inventory App - a SPA project developed with Angular using Reactive Forms and VMware's Clarity components.

Inventory App - a SPA (Single Page Application) project developed with Angular using Reactive Forms and VMware's Clarity components.

null 11 Oct 5, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
A GitHub Action that allows to debug GitHub workflows using VS Code.

VS Code Server Action A GitHub Action that allows to debug GitHub workflows using VS Code. Failing CI builds can be annoying especially since we don't

stateful 18 Dec 23, 2022
optimize image & upload file to cloud as image bed with tiny image automic.

Rush! 图片压缩 & 直传图床工具 这是一个兴趣使然的项目, 希望 Rush! 能让这个世界的网络资源浪费减少一点点 下载 Downloads 获取最新发行版 功能 Features 拖拽批量压缩图片, 支持格式 jpg/png/gif Drop to optimize, jpg/png/gif

{ Chao } 3 Nov 12, 2022
GitHub Action that posts the report in a comment on a GitHub Pull Request from coverage data generated by nyc (istanbul)

GitHub Action: Report NYC coverage GitHub Action that posts the report in a comment on a GitHub Pull Request from coverage data generated by nyc (ista

Sid 16 Nov 23, 2022
A GitHub action to submit your dependency graph from your Mill build to GitHub.

Mill Dependency Submission A GitHub action to submit your dependency graph from your Mill build to GitHub via their Dependency Submission API. The mai

Chris Kipp 6 Dec 15, 2022
🤖 GitHub Action which creates Issues from comments in your code

todo-issue[action] Disclosure Huge thanks to JasonEtco! After he decided to shut down his todo[bot] I've looked around for alternatives but decided to

Julian 17 Dec 11, 2022
Copy/paste detecting GitHub Action for programming source code (jscpd)

dry-code Copy/paste detecting GitHub Action for programming source code with jscpd Action inputs Action input Description Default Value Required optio

null 5 Dec 14, 2022
(WIP) A GitHub action that backs up your repo's source code to IPFS.

repo-backup-ipfs A GitHub Action that backs up your repository's source code to IPFS. How to use Create a workflow file in your repository at .github/

Dhaiwat Pandya 4 Oct 9, 2022
(WIP) A GitHub action that backs up your repo's source code to Arweave.

repo-backup-arweave A GitHub action that backs up your repo's source code to Arweave. How to use Create a workflow file in your repository at .github/

Dhaiwat Pandya 9 Sep 11, 2022
GitHub Action that checks code and docs for offensive / exclusive terms and provides warnings.

Inclusiveness Analyzer Make your code inclusive! The Inclusiveness Analyzer is a GitHub action that checks your repository for offensive / exclusive t

Microsoft 21 Dec 1, 2022
A github action that provides detailed bundle analysis on PRs for next.js apps

Next.js Bundle Analysis Github Action Analyzes each PR's impact on your next.js app's bundle size and displays it using a comment. Optionally supports

HashiCorp 369 Dec 27, 2022
A custom action for setting GitHub Workflow environment variables with YAML configuration files.

yaml-env-action - A custom action for setting GitHub Workflow environment variables with YAML configuration files. Introduction yaml-env-action is a c

Piper Dougherty 3 Dec 13, 2022
Setup-graalvm - GitHub Action for setting up GraalVM CE.

GitHub Action for GraalVM This GitHub action sets up GraalVM Community Edition and GraalVM components such as Native Image and GraalVM languages. Key

GraalVM 105 Jan 2, 2023
A GitHub Action for pushing to a repo.

action-gh-push A GitHub Action for pushing to a repo. ?? Usage Below is a simple example of step.if tag gating name: ci on: push jobs: build:

迷渡 6 Feb 15, 2022
A GitHub Action to cache your workload to a Google Cloud Storage bucket.

Google Cloud Storage Cache Action GitHub already provides an awesome action to cache your workload to Azure's servers hosted in United States. However

MansaGroup 9 Dec 15, 2022
GitHub action to install Foundry

foundry-toolchain Action This GitHub action installs Foundry. Example workflow on: [push] name: test jobs: check: name: Foundry project ru

Bjerg 128 Jan 5, 2023