Skip to content

Commit d187d65

Browse files
committed
chore(controller): use podman replace docker
1 parent 0393339 commit d187d65

File tree

12 files changed

+50
-53
lines changed

12 files changed

+50
-53
lines changed

.woodpecker/build-linux.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ pipeline:
1313
image: bash
1414
commands:
1515
- export VERSION=$([ -z $CI_COMMIT_TAG ] && echo latest || echo $CI_COMMIT_TAG)-$(sed 's#/#-#g' <<< $CI_SYSTEM_ARCH)
16-
- echo $CONTAINER_PASSWORD | docker login $DRYCC_REGISTRY --username $CONTAINER_USERNAME --password-stdin > /dev/null 2>&1
17-
- make docker-build docker-immutable-push
16+
- echo $CONTAINER_PASSWORD | podman login $DRYCC_REGISTRY --username $CONTAINER_USERNAME --password-stdin > /dev/null 2>&1
17+
- make podman-build podman-immutable-push
1818
secrets:
1919
- codename
2020
- dev_registry

.woodpecker/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pipeline:
1919
- name: publish-manifest
2020
image: bash
2121
commands:
22-
- docker run --rm
22+
- podman run --rm
2323
-e PLUGIN_SPEC=.woodpecker/manifest.tmpl
2424
-e PLUGIN_USERNAME=$CONTAINER_USERNAME
2525
-e PLUGIN_PASSWORD=$CONTAINER_PASSWORD

.woodpecker/test-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pipeline:
1212
- name: test-linux
1313
image: bash
1414
commands:
15-
- make test docker-build-test upload-coverage
15+
- make test podman-build-test upload-coverage
1616
secrets:
1717
- codename
1818
- dev_registry

Makefile

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ PLATFORM ?= linux/amd64,linux/arm64
77

88
include versioning.mk
99

10-
SHELLCHECK_PREFIX := docker run -v ${CURDIR}:/workdir -w /workdir ${DEV_REGISTRY}/drycc/go-dev shellcheck
10+
SHELLCHECK_PREFIX := podman run -v ${CURDIR}:/workdir -w /workdir ${DEV_REGISTRY}/drycc/go-dev shellcheck
1111
SHELL_SCRIPTS = $(wildcard rootfs/bin/*) $(shell find "rootfs" -name '*.sh') $(wildcard _scripts/*.sh)
1212

1313
# Test processes used in quick unit testing
@@ -19,44 +19,41 @@ check-kubectl:
1919
exit 2; \
2020
fi
2121

22-
check-docker:
23-
@if [ -z $$(which docker) ]; then \
24-
echo "Missing \`docker\` client which is required for development"; \
22+
check-podman:
23+
@if [ -z $$(which podman) ]; then \
24+
echo "Missing \`podman\` client which is required for development"; \
2525
exit 2; \
2626
fi
2727

28-
build: docker-build
28+
build: podman-build
2929

30-
docker-build: check-docker
31-
docker build ${DOCKER_BUILD_FLAGS} --build-arg CODENAME=${CODENAME} -t ${IMAGE} rootfs
32-
docker tag ${IMAGE} ${MUTABLE_IMAGE}
30+
podman-build: check-podman
31+
podman build --build-arg CODENAME=${CODENAME} -t ${IMAGE} rootfs
32+
podman tag ${IMAGE} ${MUTABLE_IMAGE}
3333

34-
docker-buildx: check-docker
35-
docker buildx build --build-arg CODENAME=${CODENAME} --platform ${PLATFORM} -t ${IMAGE} rootfs --push
34+
podman-build-test: check-podman
35+
podman build --build-arg CODENAME=${CODENAME} -t ${IMAGE}.test -f rootfs/Dockerfile.test rootfs
3636

37-
docker-build-test: check-docker
38-
docker build ${DOCKER_BUILD_FLAGS} --build-arg CODENAME=${CODENAME} -t ${IMAGE}.test -f rootfs/Dockerfile.test rootfs
39-
40-
deploy: check-kubectl docker-build docker-push
37+
deploy: check-kubectl podman-build podman-push
4138
kubectl --namespace=drycc patch deployment drycc-$(COMPONENT) --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value":"$(IMAGE)"}]'
4239

43-
clean: check-docker
44-
docker rmi $(IMAGE)
40+
clean: check-podman
41+
podman rmi $(IMAGE)
4542

4643
commit-hook:
4744
cp _scripts/util/commit-msg .git/hooks/commit-msg
4845

49-
full-clean: check-docker
50-
docker images -q $(IMAGE_PREFIX)/$(COMPONENT) | xargs docker rmi -f
46+
full-clean: check-podman
47+
podman images -q $(IMAGE_PREFIX)/$(COMPONENT) | xargs podman rmi -f
5148

5249
test: test-style test-unit test-functional
5350

54-
test-style: docker-build-test
55-
docker run -v ${CURDIR}:/test -w /test/rootfs ${IMAGE}.test /test/rootfs/bin/test-style
51+
test-style: podman-build-test
52+
podman run -v ${CURDIR}:/test -w /test/rootfs ${IMAGE}.test /test/rootfs/bin/test-style
5653
${SHELLCHECK_PREFIX} $(SHELL_SCRIPTS)
5754

58-
test-unit: docker-build-test
59-
docker run -v ${CURDIR}:/test -w /test/rootfs ${IMAGE}.test /test/rootfs/bin/test-unit
55+
test-unit: podman-build-test
56+
podman run -v ${CURDIR}:/test -w /test/rootfs ${IMAGE}.test /test/rootfs/bin/test-unit
6057

6158
test-functional:
6259
@echo "Implement functional tests in _tests directory"
@@ -66,6 +63,6 @@ test-integration:
6663

6764
upload-coverage:
6865
$(eval CI_ENV := $(shell curl -s https://codecov.io/env | bash))
69-
docker run --rm ${CI_ENV} -v ${CURDIR}:/test -w /test/rootfs ${IMAGE}.test /test/rootfs/bin/upload-coverage
66+
podman run --rm ${CI_ENV} -v ${CURDIR}:/test -w /test/rootfs ${IMAGE}.test /test/rootfs/bin/upload-coverage
7067

71-
.PHONY: check-kubectl check-docker build docker-build docker-build-test deploy clean commit-hook full-clean test test-style test-unit test-functional test-integration upload-coverage
68+
.PHONY: check-kubectl check-podman build podman-build podman-build-test deploy clean commit-hook full-clean test test-style test-unit test-functional test-integration upload-coverage

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ The Drycc project welcomes contributions from all developers. The high-level pro
3333

3434
## Prerequisites
3535

36-
### Docker
36+
### Podman
3737

38-
Unit tests and code linters for controller run in a Docker container with your local code directory
39-
mounted in. You need [Docker][] to run `make test`.
38+
Unit tests and code linters for controller run in a container with your local code directory
39+
mounted in. You need [Podman][] to run `make test`.
4040

4141
### Kubernetes
4242

@@ -53,13 +53,13 @@ When you've built your new feature or fixed a bug, make sure you've added approp
5353

5454
Also, since this component is central to the platform, it's recommended that you manually test and verify that your feature or fix works as expected. To do so, ensure the following environment variables are set:
5555

56-
* `DRYCC_REGISTRY` - A Docker registry that you have push access to and your Kubernetes cluster can pull from
57-
* If this is [Docker Hub](https://hub.docker.com/), leave this variable empty
58-
* `IMAGE_PREFIX` - The organization in the Docker repository. This defaults to `drycc`, but if you don't have access to that organization, set this to one you have push access to.
56+
* `DRYCC_REGISTRY` - A Container registry that you have push access to and your Kubernetes cluster can pull from
57+
* If this is [Drycc Registry](https://registry.drycc.cc/), leave this variable empty
58+
* `IMAGE_PREFIX` - The organization in the Container repository. This defaults to `drycc`, but if you don't have access to that organization, set this to one you have push access to.
5959
* `SHORT_NAME` (optional) - The name of the image. This defaults to `controller`
60-
* `VERSION` (optional) - The tag of the Docker image. This defaults to the current Git SHA (the output of `git rev-parse --short HEAD`)
60+
* `VERSION` (optional) - The tag of the Container image. This defaults to the current Git SHA (the output of `git rev-parse --short HEAD`)
6161

62-
Then, run `make deploy` to build and push a new Docker image with your changes and replace the existing one with your new one in the Kubernetes cluster. See below for an example with appropriate environment variables.
62+
Then, run `make deploy` to build and push a new Container image with your changes and replace the existing one with your new one in the Kubernetes cluster. See below for an example with appropriate environment variables.
6363

6464
```console
6565
export IMAGE_PREFIX=arschles
@@ -76,7 +76,7 @@ kubectl get pod --namespace=drycc -w | grep drycc-controller
7676
[issues]: https://github.com/drycc/controller/issues
7777
[prs]: https://github.com/drycc/controller/pulls
7878
[workflow]: https://github.com/drycc/workflow
79-
[Docker]: https://www.docker.com/
79+
[Podman]: https://podman.io/
8080

8181

8282
## License

charts/controller/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ global:
132132
#
133133
# Valid values are:
134134
# - on-cluster: Run registry within the Kubernetes cluster
135-
# - off-cluster: Use registry outside the Kubernetes cluster (example: dockerhub,self-hosted)
135+
# - off-cluster: Use registry outside the Kubernetes cluster (example: drycc registry,self-hosted)
136136
registryLocation: "on-cluster"
137137
# The host port to which registry proxy binds to
138138
registryProxyPort: 5555

rootfs/api/models/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def type(self):
3737
elif self.sha:
3838
return 'buildpack'
3939
else:
40-
# docker image (or any sort of image) used via drycc pull
40+
# container image (or any sort of image) used via drycc pull
4141
return 'image'
4242

4343
@property

rootfs/api/models/release.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def get_port(self):
6161
"""
6262
Get application port for a given release. If pulling from private registry
6363
then use default port or read from ENV var, otherwise attempt to pull from
64-
the docker image
64+
the container image
6565
"""
6666
try:
6767
envs = self.config.values

rootfs/api/tests/test_pods.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def test_container_api_heroku(self, mock_requests):
131131
response = self.client.get(url)
132132
self.assertEqual(response.status_code, 200, response.data)
133133

134-
def test_container_api_docker(self, mock_requests):
134+
def test_container_api(self, mock_requests):
135135
app_id = self.create_app()
136136

137137
# should start with zero
@@ -519,7 +519,7 @@ def test_command_good(self, mock_requests):
519519
self.assertEqual(app._get_command('web'), [])
520520
self.assertEqual(app._get_command('worker'), [])
521521

522-
# switch to docker image app
522+
# switch to container image app
523523
build.sha = ''
524524
build.save()
525525
self.assertEqual(app._get_command('web'), ['node server.js'])

rootfs/scheduler/mock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,7 @@ def __init__(self, url, k8s_api_verify_tls=True):
11101110
"bootID": "11895587-b7f1-4332-8e33-ec222c147d0b",
11111111
"kernelVersion": "4.2.2-coreos-r2",
11121112
"osImage": "CoreOS 835.12.0",
1113-
"containerRuntimeVersion": "docker://1.8.3",
1113+
"containerRuntimeVersion": "oci://1.8.3",
11141114
"kubeletVersion": "v1.1.7",
11151115
"kubeProxyVersion": "v1.1.7"
11161116
}

rootfs/scheduler/resources/pod.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,8 @@ def _set_lifecycle_hooks(container, env, **kwargs):
364364
def _default_container_readiness_probe(port, delay=5, timeout=5, period_seconds=5,
365365
success_threshold=1, failure_threshold=1):
366366
"""
367-
Applies tcp socket readiness probe to the docker app container only if some port is exposed
368-
by the docker image.
367+
Applies tcp socket readiness probe to the app container only if some port is exposed
368+
by the container image.
369369
"""
370370
readinessprobe = {
371371
'readinessProbe': {

versioning.mk

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ info:
1010
@echo "Immutable tag: ${IMAGE}"
1111
@echo "Mutable tag: ${MUTABLE_IMAGE}"
1212

13-
.PHONY: docker-push
14-
docker-push: docker-mutable-push docker-immutable-push
13+
.PHONY: podman-push
14+
podman-push: podman-mutable-push podman-immutable-push
1515

16-
.PHONY: docker-immutable-push
17-
docker-immutable-push:
18-
docker push ${IMAGE}
16+
.PHONY: podman-immutable-push
17+
podman-immutable-push:
18+
podman push ${IMAGE}
1919

20-
.PHONY: docker-mutable-push
21-
docker-mutable-push:
22-
docker push ${MUTABLE_IMAGE}
20+
.PHONY: podman-mutable-push
21+
podman-mutable-push:
22+
podman push ${MUTABLE_IMAGE}

0 commit comments

Comments
 (0)