Skip to content

Implementation for podman to be used for container images #1357

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

Merged
merged 7 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,22 @@ Before contributing to this repository for the first time, please review our pro

### Building

To build the CRD and the various schemas, you don't need to install any pre-requisite apart from `docker`.
In the root directory, just run the following command:
To build the CRD and the various schemas, you don't need to install any pre-requisite apart from `docker` or `podman`.
In the root directory, if you are using `podman` first run `export USE_PODMAN=true`. Then for either `docker` or `podman` run the following command:

```console
bash ./docker-run.sh ./build.sh
```

### Typescript model

Typescript model is generated based on JSON Schema with help of <https://github.com/kubernetes-client/gen>.
To generate them locally run:

```console
bash ./build/typescript-model/generate.sh
```

### Testing

Find more information about tests in the [testing document](test/README.md).
Expand Down
18 changes: 3 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Sources for this API are defined in Go code, starting from the
[devworkspace_types.go source file](pkg/apis/workspaces/v1alpha2/devworkspace_types.go)

From these Go sources, several files are generated:

- A Kubernetes Custom Resource Definition(CRD) with an embedded OpenApi schema,
- json schemas (in the [schemas](schemas) folder) generated from the above CRD, to specify the syntax of:
- the DevWorkspace CRD itself;
Expand All @@ -34,21 +35,7 @@ Release details and process are found in [Devfile Release](RELEASE.md)

## How to build
Copy link
Contributor

@yangcao77 yangcao77 Nov 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this section is duplicating the content in contributing doc. We shouldn't spent effort to maintain same content in separate docs. Please use the link to contributing.md, e.g. ./CONTRIBUTING.md#building

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree about the duplication :) Thinking that in general the contribution guidelines are more related to information about how someone could open a PR or an issue, I was wondering if the contributing.md is the right file to maintain this section? WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pointing that out! To remove the duplication I agree with contributing.md probably not being the right spot for the build instructions, I'll remove it from contributing and keep in in the readme.md only

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yangcao77 @thepetk please see the latest commit for my updated changes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should directly link to the building section. not the top of the contributing doc


In order to build the CRD and the various schemas, you don't need to install any pre-requisite apart from `docker`.
In the root directory, just run the following command:

```console
bash ./docker-run.sh ./build.sh
```

### Typescript model

Typescript model is generated based on JSON Schema with help of <https://github.com/kubernetes-client/gen>.
To generate them locally run:

```console
bash ./build/typescript-model/generate.sh
```
For information about building this project visit [CONTRIBUTING.md](./CONTRIBUTING.md#building).

## Specification status

Expand All @@ -61,6 +48,7 @@ In order to test existing or new Devfile 2.0 or DevWorkspace sample files in a s
[![Contribute](https://img.shields.io/badge/developer-workspace-525C86?logo=eclipse-che&labelColor=FDB940)](https://workspaces.openshift.com/f?url=https://github.com/devfile/api)

As soon as the devworkspace is opened, you should be able to:

- open the `yaml` files in the following folders:
- `samples/`
- `devfile-support/samples`
Expand Down
10 changes: 10 additions & 0 deletions docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Allow setting of podman environment var in the script runtime
shopt -s expand_aliases
set -eux

# git ROOT directory used to mount filesystem
GIT_ROOT_DIRECTORY=$(git rev-parse --show-toplevel)
Expand All @@ -23,6 +26,13 @@ WORKDIR="/projects/src/${GO_MODULE}"
# Container image
IMAGE_NAME="quay.io/devfile/kubernetes-api-build-prerequisites:latest"

# For users who want to use podman this enables the alias to work throughout the scripts runtime
USE_PODMAN=${USE_PODMAN:-false}
if [[ ${USE_PODMAN} == true ]]; then
alias docker=podman
echo "using podman as container engine"
fi

init() {
BLUE='\033[1;34m'
GREEN='\033[0;32m'
Expand Down