In case Podman or Docker is not installed, running containerized tests
or builds will fail with unclear errors.
Introduce a 'need-container-cmd' make target that checks if the
CONTAINER_CMD is available (and non-empty). When running without Podman
and Docker, the following error is displayed:
$ make containerized-build
cephcsi image settings: quay.io/cephcsi/cephcsi version canary
Missing container support, install Podman or Docker
make: *** [Makefile:135: need-container-cmd] Error 1
Signed-off-by: Niels de Vos <ndevos@redhat.com>
When building against go-ceph, the most recent version of Ceph is
assumed to be available (currently Octopus). In case an older version of
the development packages is installed, building go-ceph will fail.
Golangci-lint does not accept the `-tags nautilus` parameter like other
Golang tools. Instead, the build-constraints need to be configured in a
confguration file.
This change takes care of the following:
- move the current scripts/golangci.yml to a template
- add the @@CEPH_VERSION@@ substitute
- generate the configuration file when needed
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Build `GO_TAGS` based on the `CEPH_VERSION` from build.env. In case the
version is non-empty, pass `-tags=${CEPH_VERSION}` to any of the go
commandline and script that call go programs.
Signed-off-by: Niels de Vos <ndevos@redhat.com>
add pylint to catch static issues of python
files in the repo.
User can now run make lint-py for pylint
check on python files.
Signed-off-by: Yug Gupta <ygupta@redhat.com>
This prevents some clutter while running 'make' commands on an
environment where 'go' is not installed. There is no requirement on 'go'
in the case containers are used for building and testing.
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Run `make containerized-build TARGET=e2e.test` to build the e2e.test
executable in a container. This makes it possible for environments to
only have the dependencies for the runtime installed (most notably Ceph
shared libraries) and, run the e2e tests directly.
Signed-off-by: Niels de Vos <ndevos@redhat.com>
`make -C ${GOPATH/src/github.com/ceph/ceph-csi container...` commands
fail as the PWD variable gets substituted with the path where `make` is
called, not with the path of the Makefile that is passed with the -C
option.
The CURDIR variable is expended to the correct path, so `make -C ...`
works for all make targets now.
Signed-off-by: Niels de Vos <ndevos@redhat.com>
In case the `go` executable is not available, any `make` command shows
the error `go: command not found` even when running the actual task in a
container (that will have `go` available).
So, redirect the error message to `/dev/null`. In case `go` is really
not available in the build environment, the `check-env` make target will
report it.
Signed-off-by: Niels de Vos <ndevos@redhat.com>
When passing `GIT_SINCE` as an argument, the commits from then on
(defaults to origin/master) are used. A CI job can pass the base branch
or ID so a range of patches gets checked.
To test the last four commits, one can run:
$ make containerized-test TARGET=commitlint GIT_SINCE=HEAD~4
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Earlier we were running all the linter for non-go
files in one short, this wont be helpful for the
users who want to run particular tests.
now the Makefile as different target to
run separate lint test for different type
of non-go files.
Fixes: #979
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
If Docker does not exist, use Podman.
Use all CPUs for the build, which hopefully will make it faster.
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Fixes: #987
Running the containerized-tests is relatively time consuming as it runs
all the tests. By adding a TARGET=.. option to the Makefile, it is now
possible to run a selected test, for example:
make containerized-test TARGET=static-check
This reduces the time the tests take, so it is more friendly to the
developers while addressing problems.
When no TARGET=.. parameter is passed, the default tests are run.
Signed-off-by: Niels de Vos <ndevos@redhat.com>
The internal/ directory in Go has a special meaning, and indicates that
those packages are not meant for external consumption. Ceph-CSI does
provide public APIs for other projects to consume. There is no plan to
keep the API of the internally used packages stable.
Closes: #903
Signed-off-by: Niels de Vos <ndevos@redhat.com>
By setting the WORKDIR in the container image, there is no need to pass
it on the commandline in the Makefile. This makes the line for the make
target a little cleaner.
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Add support for multi architecture build
for cephcsi. with multistage docker build
we we build cephcsi binary for both arm64
and amd64 architecture.
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
`go mod verify` does not fail when all moduled under vendor/ are
updated. However it does update `go.mod` in case it does not reflect the
downloaded versions.
By adding this additional verification in `make mod-check`, future
updates to vendor/ will require a correct go.mod as well.
Signed-off-by: Niels de Vos <ndevos@redhat.com>
`make containerized-test` has been added as a make target. This runs the
'make test' target in a container. All test dependencies are installed
in the container once, and the container is kept around for running
`make containerized-test` subsequently.
The test container is based on Fedora:latest so that all test tools get
easily installed and are available in a recent version. The production
container is based on the Ceph container which has CentOS as Operating
System and therefor a more stable (too old) toolset.
Signed-off-by: Niels de Vos <ndevos@redhat.com>
This PR adds the support for helm
installation, and cephcsi helm charts
deployment and teardown and also runs E2E
on for helm charts.
Add socat to provide port forwadring access for helm
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This makes it possible to build on any platform that supports Linux
containers. The container image used for building is created once, or on
updating the `scripts/Dockerfile.build` and is cached afterwards.
To build the executable in a container, use `make containerized-build`
and everything will be done automatically. The executable will also be
available on the usual location.
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Update CI merge job to build and push Arm64 image to
quay.io/cephcsi/cephcsi:version-arm64.
Add CI PR job running on Travis Arm64 nodes to make sure cephcsi
compiles successfully on Arm64.
No CI test job is availabe for Arm64 now due to below issues
- k8s-csi sidecar images for Arm64 are not available
- Travis Arm64 CI job runs inside unprivileged LXD which blocks
launching minikube test environment
Signed-off-by: Yibo Cai <yibo.cai@arm.com>
update driver version and add git commit
to the image. This will help us to identify
what latest git commit image contains.
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
update travis and makefile for functional test
skip docker pull if image is already present
on local machine.
if the image is not present locally pull the
image from repo.
export kubeconfig in travis
build cephcsi image in travis job for
functional testing
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
currently, we have 3 docker files(cephcsi,rbd,cephfs) in the ceph-csi repo.
[commit ](85e121ebfe)
added by John to build a single image which can act as rbd or
cephfs based on the input configuration.
This PR updates the makefile and kubernetes templates to use
the unified image and also its deletes the other two dockerfiles.
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
updated deploy.sh script to push images
to quay.io with canary tag.
Once we merge a PR against master and csi-v0.3
branches we need to build and push the latest
image with canary tag. by doing this we can
avoid the accidental update of the images which
are already deployed with stable tags
(i.e v1.0.0 or v0.3.0).
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
Add rules and variables to the Makefile so that the unified binary
and container image can be built.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
This change allows the use of alternatives to or wrappers around
the normal docker command for container builds.
Example 1: make image-rbdplugin CONTAINER_CMD=podman
Example 2: CONTAINER_CMD=podman make image-rbdplugin
Signed-off-by: John Mulligan <jmulligan@redhat.com>
This change adds the ability to define a `multiNodeWritable` option in
the Storage Class.
This change does a number of things:
1. Allow multi-node-multi-writer access modes if the SC options is
enabled
2. Bypass the watcher checks for MultiNodeMultiWriter Volumes
3. Maintains existing watcher checks for SingleNodeWriter access modes
regardless of the StorageClass option.
fix lint-errors