Skip to content

Commit

Permalink
Implementation for podman to be used for container images (#1357)
Browse files Browse the repository at this point in the history
* add setenv script

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>

* update run script to include podman capabilities

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>

* update documentation to reflect podman implementation

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>

* update documentation to remove duplicate entries

Signed-off-by: Jordan Dubrick <dubrickjordan@gmail.com>

* add inline setting of alias to remove need for additional script

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>

* fix unset variable

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>

---------

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <dubrickjordan@gmail.com>
  • Loading branch information
Jdubrick authored Nov 22, 2023
1 parent adb72c3 commit e37cd6b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
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

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

0 comments on commit e37cd6b

Please sign in to comment.