Skip to content

Commit 6c1e43d

Browse files
authored
HDDS-12441. Add helper script for building Docker image (#11)
1 parent 0ecbe1e commit 6c1e43d

File tree

4 files changed

+111
-5
lines changed

4 files changed

+111
-5
lines changed

.dockerignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.asf.yaml
2+
build.sh
3+
CONTRIBUTING.md
4+
.git
5+
.github
6+
LICENSE
7+
NOTICE
8+
README.md
9+
SECURITY.md

CONTRIBUTING.md

+63-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,66 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
118
# Contributing
219

3-
For detailed contribution guideline, please check the [contribution guideline of Apache Ozone repository](https://github.com/apache/ozone/blob/master/CONTRIBUTING.md).
20+
For general contribution guideline, please check the [Apache Ozone repository](https://github.com/apache/ozone/blob/master/CONTRIBUTING.md).
21+
22+
Development of the `ozone-testkrb5` image happens on branch `master`.
23+
24+
## Local Build and Test
25+
26+
### Building
27+
28+
The image can be built simply by running the helper script `build.sh`:
29+
30+
```bash
31+
$ ./build.sh
32+
...
33+
=> => naming to docker.io/apache/ozone-testkrb5:dev
34+
```
35+
36+
This will create a single-platform image for your architecture.
37+
38+
### Testing
39+
40+
To try the image locally with Ozone acceptance tests:
41+
42+
1. Update `docker.ozone-testkr5b.image` to `<username>/ozone-testkrb5:<commit SHA>` in [hadoop-ozone/dist/pom.xml](https://github.com/apache/ozone/blob/bb16f66e22c44b360d42d0cae87024786e27c61b/hadoop-ozone/dist/pom.xml#L29).
43+
2. Rebuild Ozone.
44+
3. Run [acceptance tests](https://github.com/apache/ozone/blob/master/hadoop-ozone/dist/src/main/compose/README.md) as needed.
45+
46+
## GitHub Workflows
47+
48+
If this is your first time working on the image, please enable GitHub Actions workflows after forking the repo.
49+
50+
### Building
51+
52+
Whenever changes are pushed to your fork, GitHub builds a multi-platform image (for `amd64` and `arm64`), and tags it with the commit SHA. These images can be shared with other developers for feedback. Workflow runs are listed at `https://github.com/<username>/ozone-docker-testkrb5/actions`, images at `https://github.com/<username>/ozone-docker-testkrb5/pkgs/container/ozone-testkrb5`.
53+
54+
### Testing
55+
56+
To run complete Ozone CI with the custom image:
57+
58+
1. Create a new branch in your clone of `apache/ozone`.
59+
2. Update `docker.ozone-testkr5b.image` as described above.
60+
3. Commit the change and push to your fork of `apache/ozone`.
61+
62+
## Publishing Docker Tags (for committers)
463

64+
1. Fetch changes to your local clone.
65+
2. Add a Git tag for the commit following the existing pattern `<date>-<n>`, where `<n>` starts at 1, and is incremented if multiple images need to be published the same day.
66+
3. Push the Git tag to the official repo (`apache/ozone-docker-testkrb5`). This will trigger a workflow to apply the tag to the Docker image.

README.md

+20-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
1-
# Containerized MIT Kerberos server for Ozone dev environments
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
28
3-
This repository contains the definition of a containerized MIT Kerberos server.
9+
http://www.apache.org/licenses/LICENSE-2.0
410
5-
It's used for development and testing Apache Ozone and **not secured for production use**.
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
617

7-
Keytabs required by secure Ozone smoketests are pre-generated which makes possible to export them and store together with the containerized test environments. It makes the tests faster as the keytabs are already exported for each tests.
18+
# MIT Kerberos KDC for developing and testing Apache Ozone
819

20+
[ozone-testkrb5](https://github.com/apache/ozone-docker-testkrb5) is used as KDC for testing Apache Ozone with Kerberos enabled.
21+
22+
Published only to [GitHub](https://github.com/apache/ozone-docker-testkrb5/pkgs/container/ozone-testkrb5), because it is completely insecure, and should be used only for testing, **not for production**.
23+
24+
Images are tagged by date.

build.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -eu -o pipefail
18+
19+
docker build -t apache/ozone-testkrb5:dev "$@" .

0 commit comments

Comments
 (0)