Skip to content

Commit

Permalink
feat: fixing liniting issues
Browse files Browse the repository at this point in the history
#181

Summary of changes:
- Fixed linting issues: mostly spelling in README and comments.
  • Loading branch information
Ivan Chvets committed Feb 6, 2023
1 parent c20a311 commit 3035c12
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions image-definitions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This directory contains image definitions for containers that are used in deployment of Notebook Operators. Only selected container images are maintained. The list of images and/or repositories can change. In addition, tools required to maintain container images are included in this repository:

- `setup.sh` - Used to setup initial image definitions and in maintanance of image definitions.
- `setup.sh` - Used to setup initial image definitions and in maintenance of image definitions.
- `install-tools.sh` - Install all required tools for building, scanning, and publishing container images.
- `build.sh` - Build container images.
- `publish.sh` - Publish container images.
Expand All @@ -12,7 +12,7 @@ See [#Usage] for more details on each tool.

## Image Definitions

Image definitions contain patches for selected sources from upstream. These differ from one repository to the next. Scripts should be updated accordingly. In addtion, it is a good practice to update this README file with what repositories are tracked.
Image definitions contain patches for selected sources from upstream. These differ from one repository to the next. Scripts should be updated accordingly. In addition, it is a good practice to update this README file with what repositories are tracked.

### Kubeflow

Expand All @@ -22,15 +22,15 @@ Kubeflow repository `https://github.com/kubeflow/kubeflow.git`.

For detailed resources that these images require refer to `setup.sh` script.

There were modification done to `Makefile`, `Dockerfile`, and `requirements.*` files to ensure bulding only required images.
There were modification done to `Makefile`, `Dockerfile`, and `requirements.*` files to ensure building only required images.

When repository is setup a version of Kubeflow is retrieved and stored in `./kubeflow/version.txt` and a current commit is stored in `./kubeflow-patch-commit.txt`. The latter file is used in tagging images with specific commit ID. In addition, it can be used to the exact version of the tree the patch was created with.

## Usage

This repository contains tools - a collection of `bash` scripts - that help in maintenance of image definitions. All these tools are specific to image definitions for the repository they are in. Different repositories can be included and scripts are adjusted accordingly.

Required tools include Docker which might cause some conflicts on development machines. If required, image definiton work can be done in isolation on a VM. Using `multipass` create a VM and log into it:
Required tools include Docker which might cause some conflicts on development machines. If required, image definition work can be done in isolation on a VM. Using `multipass` create a VM and log into it:

```
multipass launch 20.04 --cpus 2 --mem 8G --disk 100G --name docker-vm
Expand All @@ -57,7 +57,7 @@ setup.sh .

This will perform a sparse checkout of all required repositories in current (`.`) directory. Refer to `setup.sh` script for more detail on what directories are created. Those are also described in [Image Definitions](#image-definitions) section of this README.

Refere to [Maintenance](#maintenance) section for more details on how to use and create patches.
Refer to [Maintenance](#maintenance) section for more details on how to use and create patches.

### Build

Expand Down Expand Up @@ -136,7 +136,7 @@ git diff > ../kubeflow.patch
git rev-parse --short HEAD > ../kubeflow-patch-commit.txt
```

Commit this patch to this repository. Commit `./kubeflow-patch-commit.txt` to this repository as well. This will ensure that it is possible to retrieve exact copy of the tree which `./kubeflow.patch` was based on. If required to work on particular version/commit of Kubeflow tree, after cloning this repo make a note of the commig stored in `./kubeflow-patch-commit.txt`, setup Kubeflow tree and checkout the noted commit ID. Then do the required work. Also note that scripts depend on `kubeflow-patch-commit.txt` file for tagging images.
Commit this patch to this repository. Commit `./kubeflow-patch-commit.txt` to this repository as well. This will ensure that it is possible to retrieve exact copy of the tree which `./kubeflow.patch` was based on. If required to work on particular version/commit of Kubeflow tree, after cloning this repo make a note of the commit stored in `./kubeflow-patch-commit.txt`, setup Kubeflow tree and checkout the noted commit ID. Then do the required work. Also note that scripts depend on `kubeflow-patch-commit.txt` file for tagging images.

From time to time an update in upstream source, an addition of new container image, or a new vulnerability fix will require re-evaluation of image definitions. To perform difference analysis between upstream, set up a clean copy of upstream source, apply existing patch and diff the contents with current image definitions.

Expand All @@ -151,11 +151,11 @@ git diff

Analyze differences and act accordingly, i.e. change `Makefiles` and/or `Dockerfile(s)`, add, remove, or modify image definitions in this repository.

In many cases difference in `Makefile(s)`, `Dockerfile(s)`, and `requirements.*` files should be carefully reviewed. Other files could be copied directrly.
In many cases difference in `Makefile(s)`, `Dockerfile(s)`, and `requirements.*` files should be carefully reviewed. Other files could be copied directly.

This is a manual merge process. No automation can be done at this point.

Whenever making changes to image definitions include meaninful commit message that explains why changes were made.
Whenever making changes to image definitions include meaningful commit message that explains why changes were made.

If patch fails, examine which lines cause the problem and analyze the differences. In some cases upstream change could be integrated into patch. In other cases changes should be made to override that change.

Expand Down
4 changes: 2 additions & 2 deletions image-definitions/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
# Create directory and checkout specified components from upstream repositories.
# The directory specified below should not exist in <local-directory>.
# Updated upstream version of component is checked out from specified branch and then all git
# information is deleted, leaving only the resouces required for image definitions.
# information is deleted, leaving only the resources required for image definitions.
# Use this script in setting up new image definitions or creating a copy to check for
# differences between existing image definitions and upstream vesions.
# differences between existing image definitions and upstream versions.
# This script should be specific for the charm repository.
#
# Usage:
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ deps =
-r requirements-integration.txt
commands = pytest -vvs --tb native --show-capture=no --log-cli-level=INFO --asyncio-mode=auto {posargs} {toxinidir}/tests/

# image defintions maintenance: container image patch, build, scan, and publish
# image definitions maintenance: container image patch, build, scan, and publish
# See ./image-definitions/README.md for more details.
[testenv:images-setup]
whitelist_externals = bash
Expand Down

0 comments on commit 3035c12

Please sign in to comment.