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

Refactor docker images and workflows to build and deploy them #22

Merged
merged 4 commits into from
Jul 29, 2024

Conversation

andistorm
Copy link
Contributor

@andistorm andistorm commented Jul 8, 2024

Changes

  • Remove workflow deploy-build-kit.yaml. It is integrated into
    deploy-docker-images.yml.
  • Refactor deploy-docker-images.yml workflow
    • Convert matrix into multiple jobs, one for each docker image,
      because the images depend on each other, and the matrix strategy
      does not support this.
    • Add env-setup job to set up the environment for the other jobs,
      because reusable workflows don't support environment variables.
    • Add input parameter to build deprecated images. Currently, the
      deprecated images are built by default, if not specified otherwise.
    • Use output one_image_tag_short as input for the dependent images
  • Refactor build-single-docker-image.yml
    • Rename input docker_directory to directory. Instead of setting the
      directory that contains all images, it is set now to the directory that
      contains the Dockerfile for the image to build.
    • Add input parameter docker_file_name to specify the Dockerfile to use.
    • Add input parameter platforms to specify the platforms to build the
      image for. The default is linux/amd64,linux/arm64 and linux/arm/v7.
    • Add input parameter depends_on_paths to specify the paths that the
      image depends on. If the paths change, the image is rebuilt.
    • Add input parameter build_args to specify the build arguments for the
      image.
    • The name of the deployed image is now set by the input parameter
      image_name: ghcr.io/everest/<image_name>. The directory name is
      independent of the image name.
    • Add output parameter rebuild to indicate if the image was rebuilt.
    • Add output parameter image_tag_short to pass the image tag to the
      dependent images.
    • Add output parameter image_tag_long to pass the full image tag to the
      dependent images.
    • Add output parameter image_tags to pass all full image tags.
    • Fix rebuild conditions
  • Update README.md
  • Deprecate ghcr.io/everest/everest-clang-format image. Its features are now included in
    ghcr.io/everest/everest-ci/build-env-base The old image is deprecated, but still available and deployed.
  • Merge ghcr.io/everest/build-kit-alpine and
    ghcr.io/everest/build-kit-debian into ghcr.io/everest/everest-ci/build-kit-base.
    The old images are deprecated, but still available and deployed.
  • Add ghcr.io/everest/everest-ci/run-env-base image
  • Add ghcr.io/everest/everest-ci/build-env-base image
  • Add ghcr.io/everest/everest-ci/dev-env-base image
  • Add run-clang-format.py script to build-env-base image
  • Update github action run-glang-format to use new build-env-base image

Related

@andistorm andistorm force-pushed the refactor-docker-images branch 2 times, most recently from 280f294 to 3a55070 Compare July 9, 2024 07:20
@andistorm andistorm marked this pull request as ready for review July 9, 2024 07:21
@andistorm andistorm requested a review from hikinggrass July 9, 2024 07:21
@andistorm andistorm force-pushed the refactor-docker-images branch 2 times, most recently from 160cead to 784ca4d Compare July 10, 2024 05:06
@andistorm andistorm force-pushed the refactor-docker-images branch from 99e750f to 58530ef Compare July 16, 2024 07:47
    * Remove workflow `deploy-build-kit.yaml`. It is integrated into
        `deploy-docker-images.yml`.
    * Refactor deploy-docker-images.yml workflow
        * Convert matrix into multiple jobs, one for each docker image,
        because the images depend on each other, and the matrix strategy
        does not support this.
        * Add `env-setup` job to set up the environment for the other jobs,
        because reusable workflows don't support environment variables.
        * Add input parameter to build deprecated images. Currently, the
        deprecated images are built by default, if not specified otherwise.
        * Use output `one_image_tag_short` as input for the dependent images
    * Refactor build-single-docker-image.yml
        * Rename input `docker_directory` to `directory`. Instead of setting the
        directory that contains all images, it is set now to the directory that
        contains the Dockerfile for the image to build.
        * Add input parameter `docker_file_name` to specify the Dockerfile to use.
        * Add input parameter `platforms` to specify the platforms to build the
        image for. The default is `linux/amd64,linux/arm64` and `linux/arm/v7`.
        * Add input parameter `depends_on_paths` to specify the paths that the
        image depends on. If the paths change, the image is rebuilt.
        * Add input parameter `build_args` to specify the build arguments for the
        image.
        * The name of the deployed image is now set by the input parameter
        `image_name`: `ghcr.io/everest/<image_name>`. The directory name is
        independent of the image name.
        * Add output parameter `rebuild` to indicate if the image was rebuilt.
        * Add output parameter `image_tag_short` to pass the image tag to the
        dependent images.
        * Add output parameter `image_tag_long` to pass the full image tag to the
        dependent images.
        * Add output parameter `image_tags` to pass all full image tags.
        * Fix rebuild conditions
    * Update README.md
    * Deprecate `ghcr.io/everest/everest-clang-format` image. Its features are now included in
        `ghcr.io/everest/everest-ci/build-env-base` The old image is deprecated, but still available and deployed.
    * Merge `ghcr.io/everest/build-kit-alpine` and
        `ghcr.io/everest/build-kit-debian` into `ghcr.io/everest/everest-ci/build-kit-base`.
        The old images are deprecated, but still available and deployed.
    * Add `ghcr.io/everest/everest-ci/run-env-base` image
    * Add `ghcr.io/everest/everest-ci/build-env-base` image
    * Add `ghcr.io/everest/everest-ci/dev-env-base` image
    * Add `run-clang-format.py` script to `build-env-base` image
    * Update github action `run-glang-format` to use new `build-env-base` image

Signed-off-by: Andreas Heinrich <[email protected]>
@andistorm andistorm force-pushed the refactor-docker-images branch from 6188a92 to b7b5581 Compare July 16, 2024 13:17
docker/deprecated-images/build-kit/deprecated_wrapper Outdated Show resolved Hide resolved
docker/deprecated-images/build-kit/maven-settings.xml Outdated Show resolved Hide resolved
docker/images/build-env-base/Dockerfile Outdated Show resolved Hide resolved
docker/images/build-env-base/Dockerfile Outdated Show resolved Hide resolved
docker/images/build-env-base/Dockerfile Outdated Show resolved Hide resolved
docker/images/build-env-base/Dockerfile Outdated Show resolved Hide resolved
docker/images/build-kit-base/Dockerfile Outdated Show resolved Hide resolved
docker/images/build-kit-base/entrypoint.sh Outdated Show resolved Hide resolved
docker/images/build-kit-base/maven-settings.xml Outdated Show resolved Hide resolved
@andistorm andistorm requested a review from hikinggrass July 17, 2024 07:02
…core to everest-ci/build-env-base

* Move documentation related build tools from everest/build-env-everest to everest-ci/build-env-base
* Remove documentation related build tools from everest-ci/dev-env-base, since they are included in everest-ci/build-env-base

Signed-off-by: Andreas Heinrich <[email protected]>
@andistorm andistorm merged commit 2b0a910 into main Jul 29, 2024
16 of 17 checks passed
@andistorm andistorm deleted the refactor-docker-images branch July 29, 2024 10:56
shankari added a commit to US-JOET/everest-demo that referenced this pull request Nov 14, 2024
- The alpine build-kit is now deprecated, use the recommended
  one
EVerest#78 (comment)

```
---------------------------------------------
WARNING
This docker image is depreacted.
Please use the debian based build-kit 'ghcr.io/everest/everest-ci/build-kit-base' instead.
Fore more information see EVerest/everest-ci#22
---------------------------------------------
```

- Now that there is a standard install script, instead of
  only test-and-install, so that we can roll forward

EVerest#78 (comment)

Testing done:
- Built successfully using a container
- Ran the `everest-demo/docker-compose.yml` and
  `everest-demo/docker-compose.iso15118-dc.yml` scripts. Both
  worked.
- Testing `everest-demo/docker-compose.ocpp201.yml` fails because go is running into SSL issues on my work laptop. Need to figure out how to resolve that
EVerest#78 (comment)

Signed-off-by: Shankari <[email protected]>
shankari added a commit to US-JOET/everest-demo that referenced this pull request Nov 14, 2024
- The alpine build-kit is now deprecated, use the recommended
  one
EVerest#78 (comment)

```
---------------------------------------------
WARNING
This docker image is depreacted.
Please use the debian based build-kit 'ghcr.io/everest/everest-ci/build-kit-base' instead.
Fore more information see EVerest/everest-ci#22
---------------------------------------------
```

- Now that there is a standard install script, instead of
  only test-and-install, so that we can roll forward

EVerest#78 (comment)

Testing done:
- Built successfully using a container
- Ran the `everest-demo/docker-compose.yml` and
  `everest-demo/docker-compose.iso15118-dc.yml` scripts. Both
  worked.
- Testing `everest-demo/docker-compose.ocpp201.yml` fails because go is running into SSL issues on my work laptop. Need to figure out how to resolve that
EVerest#78 (comment)

Signed-off-by: Shankari <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants