mirror of https://github.com/containers/podman.git
Merge pull request #1254 from mheon/systemd_cgroups_default
Switch default CGroup manager to systemd
This commit is contained in:
commit
7d116f5f73
8
Makefile
8
Makefile
|
@ -148,10 +148,10 @@ dbuild: libpodimage
|
||||||
docker run --name=${LIBPOD_INSTANCE} --privileged ${LIBPOD_IMAGE} -v ${PWD}:/go/src/${PROJECT} --rm ${ENTRYPOINT} make binaries
|
docker run --name=${LIBPOD_INSTANCE} --privileged ${LIBPOD_IMAGE} -v ${PWD}:/go/src/${PROJECT} --rm ${ENTRYPOINT} make binaries
|
||||||
|
|
||||||
test: libpodimage
|
test: libpodimage
|
||||||
docker run -e STORAGE_OPTIONS="--storage-driver=vfs" -e TESTFLAGS -e TRAVIS -t --privileged --rm -v ${CURDIR}:/go/src/${PROJECT} ${LIBPOD_IMAGE} ${ENTRYPOINT} make clean all localunit localintegration
|
docker run -e STORAGE_OPTIONS="--storage-driver=vfs" -e TESTFLAGS -e CGROUP_MANAGER=cgroupfs -e TRAVIS -t --privileged --rm -v ${CURDIR}:/go/src/${PROJECT} ${LIBPOD_IMAGE} ${ENTRYPOINT} make clean all localunit localintegration
|
||||||
|
|
||||||
integration: libpodimage
|
integration: libpodimage
|
||||||
docker run -e STORAGE_OPTIONS="--storage-driver=vfs" -e TESTFLAGS -e TRAVIS -t --privileged --rm -v ${CURDIR}:/go/src/${PROJECT} ${LIBPOD_IMAGE} ${ENTRYPOINT} make clean all localintegration
|
docker run -e STORAGE_OPTIONS="--storage-driver=vfs" -e TESTFLAGS -e CGROUP_MANAGER=cgroupfs -e TRAVIS -t --privileged --rm -v ${CURDIR}:/go/src/${PROJECT} ${LIBPOD_IMAGE} ${ENTRYPOINT} make clean all localintegration
|
||||||
|
|
||||||
integration.fedora:
|
integration.fedora:
|
||||||
DIST=Fedora sh .papr_prepare.sh
|
DIST=Fedora sh .papr_prepare.sh
|
||||||
|
@ -160,10 +160,10 @@ integration.centos:
|
||||||
DIST=CentOS sh .papr_prepare.sh
|
DIST=CentOS sh .papr_prepare.sh
|
||||||
|
|
||||||
shell: libpodimage
|
shell: libpodimage
|
||||||
docker run --tmpfs -e STORAGE_OPTIONS="--storage-driver=vfs" -e TESTFLAGS -e TRAVIS -it --privileged --rm -v ${CURDIR}:/go/src/${PROJECT} ${LIBPOD_IMAGE} ${ENTRYPOINT} sh
|
docker run --tmpfs -e STORAGE_OPTIONS="--storage-driver=vfs" -e CGROUP_MANAGER=cgroupfs -e TESTFLAGS -e TRAVIS -it --privileged --rm -v ${CURDIR}:/go/src/${PROJECT} ${LIBPOD_IMAGE} ${ENTRYPOINT} sh
|
||||||
|
|
||||||
testunit: libpodimage
|
testunit: libpodimage
|
||||||
docker run -e STORAGE_OPTIONS="--storage-driver=vfs" -e TESTFLAGS -e TRAVIS -t --privileged --rm -v ${CURDIR}:/go/src/${PROJECT} ${LIBPOD_IMAGE} ${ENTRYPOINT} make localunit
|
docker run -e STORAGE_OPTIONS="--storage-driver=vfs" -e TESTFLAGS -e CGROUP_MANAGER=cgroupfs -e TRAVIS -t --privileged --rm -v ${CURDIR}:/go/src/${PROJECT} ${LIBPOD_IMAGE} ${ENTRYPOINT} make localunit
|
||||||
|
|
||||||
localunit: varlink_generate
|
localunit: varlink_generate
|
||||||
$(GO) test -tags "$(BUILDTAGS)" -cover $(PACKAGES)
|
$(GO) test -tags "$(BUILDTAGS)" -cover $(PACKAGES)
|
||||||
|
|
|
@ -39,6 +39,7 @@ class PodmanTestCase(unittest.TestCase):
|
||||||
tmpdir = os.environ.get('TMPDIR', '/tmp')
|
tmpdir = os.environ.get('TMPDIR', '/tmp')
|
||||||
podman_args = [
|
podman_args = [
|
||||||
'--storage-driver=vfs',
|
'--storage-driver=vfs',
|
||||||
|
'--cgroup-manager=cgroupfs',
|
||||||
'--root={}/crio'.format(tmpdir),
|
'--root={}/crio'.format(tmpdir),
|
||||||
'--runroot={}/crio-run'.format(tmpdir),
|
'--runroot={}/crio-run'.format(tmpdir),
|
||||||
'--cni-config-dir={}/cni/net.d'.format(tmpdir),
|
'--cni-config-dir={}/cni/net.d'.format(tmpdir),
|
||||||
|
|
|
@ -111,6 +111,7 @@ PODMAN_ARGS="--storage-driver=vfs \
|
||||||
--root=${TMPDIR}/crio \
|
--root=${TMPDIR}/crio \
|
||||||
--runroot=${TMPDIR}/crio-run \
|
--runroot=${TMPDIR}/crio-run \
|
||||||
--cni-config-dir=$CNI_CONFIG_PATH \
|
--cni-config-dir=$CNI_CONFIG_PATH \
|
||||||
|
--cgroup-manager=cgroupfs \
|
||||||
"
|
"
|
||||||
if [[ -n $VERBOSE ]]; then
|
if [[ -n $VERBOSE ]]; then
|
||||||
PODMAN_ARGS="$PODMAN_ARGS --log-level=$LOG_LEVEL"
|
PODMAN_ARGS="$PODMAN_ARGS --log-level=$LOG_LEVEL"
|
||||||
|
|
|
@ -30,7 +30,7 @@ conmon_env_vars = [
|
||||||
]
|
]
|
||||||
|
|
||||||
# CGroup Manager - valid values are "systemd" and "cgroupfs"
|
# CGroup Manager - valid values are "systemd" and "cgroupfs"
|
||||||
cgroup_manager = "cgroupfs"
|
cgroup_manager = "systemd"
|
||||||
|
|
||||||
# Directory for persistent libpod files (database, etc)
|
# Directory for persistent libpod files (database, etc)
|
||||||
# By default, this will be configured relative to where containers/storage
|
# By default, this will be configured relative to where containers/storage
|
||||||
|
|
|
@ -178,7 +178,7 @@ var (
|
||||||
ConmonEnvVars: []string{
|
ConmonEnvVars: []string{
|
||||||
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
||||||
},
|
},
|
||||||
CgroupManager: CgroupfsCgroupsManager,
|
CgroupManager: SystemdCgroupsManager,
|
||||||
HooksDir: hooks.DefaultDir,
|
HooksDir: hooks.DefaultDir,
|
||||||
StaticDir: filepath.Join(storage.DefaultStoreOptions.GraphRoot, "libpod"),
|
StaticDir: filepath.Join(storage.DefaultStoreOptions.GraphRoot, "libpod"),
|
||||||
TmpDir: "",
|
TmpDir: "",
|
||||||
|
|
|
@ -29,6 +29,7 @@ var (
|
||||||
CNI_CONFIG_DIR string
|
CNI_CONFIG_DIR string
|
||||||
RUNC_BINARY string
|
RUNC_BINARY string
|
||||||
INTEGRATION_ROOT string
|
INTEGRATION_ROOT string
|
||||||
|
CGROUP_MANAGER = "systemd"
|
||||||
STORAGE_OPTIONS = "--storage-driver vfs"
|
STORAGE_OPTIONS = "--storage-driver vfs"
|
||||||
ARTIFACT_DIR = "/tmp/.artifacts"
|
ARTIFACT_DIR = "/tmp/.artifacts"
|
||||||
CACHE_IMAGES = []string{ALPINE, BB, fedoraMinimal, nginx, redis, registry}
|
CACHE_IMAGES = []string{ALPINE, BB, fedoraMinimal, nginx, redis, registry}
|
||||||
|
@ -60,6 +61,7 @@ type PodmanTest struct {
|
||||||
SignaturePolicyPath string
|
SignaturePolicyPath string
|
||||||
ArtifactPath string
|
ArtifactPath string
|
||||||
TempDir string
|
TempDir string
|
||||||
|
CgroupManager string
|
||||||
}
|
}
|
||||||
|
|
||||||
// HostOS is a simple struct for the test os
|
// HostOS is a simple struct for the test os
|
||||||
|
@ -141,6 +143,10 @@ func PodmanCreate(tempDir string) PodmanTest {
|
||||||
if os.Getenv("STORAGE_OPTIONS") != "" {
|
if os.Getenv("STORAGE_OPTIONS") != "" {
|
||||||
storageOptions = os.Getenv("STORAGE_OPTIONS")
|
storageOptions = os.Getenv("STORAGE_OPTIONS")
|
||||||
}
|
}
|
||||||
|
cgroupManager := CGROUP_MANAGER
|
||||||
|
if os.Getenv("CGROUP_MANAGER") != "" {
|
||||||
|
cgroupManager = os.Getenv("CGROUP_MANAGER")
|
||||||
|
}
|
||||||
|
|
||||||
runCBinary := "/usr/bin/runc"
|
runCBinary := "/usr/bin/runc"
|
||||||
CNIConfigDir := "/etc/cni/net.d"
|
CNIConfigDir := "/etc/cni/net.d"
|
||||||
|
@ -156,6 +162,7 @@ func PodmanCreate(tempDir string) PodmanTest {
|
||||||
SignaturePolicyPath: filepath.Join(INTEGRATION_ROOT, "test/policy.json"),
|
SignaturePolicyPath: filepath.Join(INTEGRATION_ROOT, "test/policy.json"),
|
||||||
ArtifactPath: ARTIFACT_DIR,
|
ArtifactPath: ARTIFACT_DIR,
|
||||||
TempDir: tempDir,
|
TempDir: tempDir,
|
||||||
|
CgroupManager: cgroupManager,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setup registries.conf ENV variable
|
// Setup registries.conf ENV variable
|
||||||
|
@ -165,8 +172,8 @@ func PodmanCreate(tempDir string) PodmanTest {
|
||||||
|
|
||||||
//MakeOptions assembles all the podman main options
|
//MakeOptions assembles all the podman main options
|
||||||
func (p *PodmanTest) MakeOptions() []string {
|
func (p *PodmanTest) MakeOptions() []string {
|
||||||
return strings.Split(fmt.Sprintf("--root %s --runroot %s --runtime %s --conmon %s --cni-config-dir %s",
|
return strings.Split(fmt.Sprintf("--root %s --runroot %s --runtime %s --conmon %s --cni-config-dir %s --cgroup-manager %s",
|
||||||
p.CrioRoot, p.RunRoot, p.RunCBinary, p.ConmonBinary, p.CNIConfigDir), " ")
|
p.CrioRoot, p.RunRoot, p.RunCBinary, p.ConmonBinary, p.CNIConfigDir, p.CgroupManager), " ")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Podman is the exec call to podman on the filesystem, uid and gid the credentials to use
|
// Podman is the exec call to podman on the filesystem, uid and gid the credentials to use
|
||||||
|
|
Loading…
Reference in New Issue