github.com/Racer159/jackal@v0.32.7-0.20240401174413-0bd2339e4f2e/docs/5-jackal-tutorials/10-package-create-differential.md (about)

     1  # Differential Packages with Jackal
     2  
     3  ## Introduction
     4  
     5  In this tutorial, you will create a differential package using Jackal.  This is useful when deploying updates to a package that shares common git repositories and container images across versions.  Differential packages only pack what has changed, ensuring that those resources will only need to be packaged and deployed once.
     6  
     7  ## System Requirements
     8  
     9  - Internet access to download resources or upload packages
    10  - Access to a registry (this tutorial uses Docker Hub)
    11  
    12  ## Prerequisites
    13  
    14  For following along locally, please ensure the following prerequisites are met:
    15  
    16  - Jackal binary installed on your `$PATH`: ([Installing Jackal](../1-getting-started/index.md#installing-jackal))
    17  - The [Jackal](https://github.com/Racer159/jackal) repository cloned: ([`git clone` Instructions](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository))
    18  
    19  ## Youtube Tutorial
    20  
    21  [![Tutorial: Create Differential Packages with Jackal](../.images/tutorials/differential_package_thumbnail.png)](https://youtu.be/6yQEo4Vhz9o "Create Differential Packages with Jackal")
    22  
    23  ## Create a Differential Package
    24  
    25  In this example we're going to use the [Longhorn Example](../../examples/longhorn/) to create a differential package.
    26  
    27  :::note
    28  
    29  You'll notice we're not using a cluster in this example.  That's because differential packages only affect package creation and do not require a running cluster to make.
    30  
    31  :::
    32  
    33  1. From the `examples/longhorn` folder, Create the Jackal package with the `jackal package create` command.
    34  
    35  <iframe src="/docs/tutorials/differential_package_create.html" width="100%" height="600px"></iframe>
    36  
    37  2. Modify the `jackal.yaml` file to upgrade all of the 1.4.0 images to version 1.4.2; leave everything else the same.  
    38  
    39  3. Update the version of the package as well in the [metadata.version](/docs/create-a-jackal-package/jackal-schema#metadata) field.
    40  
    41  :::caution
    42  
    43  Creating differential packages without updating the package version will result in an error.
    44  
    45  <iframe src="/docs/tutorials/differential_package_error.html" width="100%" height="180px"></iframe>
    46  
    47  :::
    48  
    49  <iframe src="/docs/tutorials/differential_package_edit.html" width="100%" height="600px"></iframe>
    50  
    51  4. Next, use the `jackal package create` command with the `--differential` flag to specify a reference package.  This will build the differential package omitting the images, repositories, and OCI skeleton components that are already present in the specified Jackal package and are pinned to a specific version/shasum.
    52  
    53  <iframe src="/docs/tutorials/differential_package_create_differential.html" width="100%" height="600px"></iframe>
    54  
    55  ## Conclusion
    56  
    57  You have now learned to create differential packages with Jackal.  If you would like to see the size you saved, you can use the `jackal package create` command without the `--differential` flag.  You'll notice a size difference between the two packages since the differential package omits duplicate contents.
    58  
    59  <iframe src="/docs/tutorials/differential_package_create_conclusion.html" width="100%" height="600px"></iframe>