Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: humblec/gluster-containers
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: gluster/gluster-containers
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.

Commits on Jan 23, 2020

  1. Copy the full SHA
    0621327 View commit details

Commits on Aug 14, 2020

  1. Merge pull request #165 from kshithijiyer/patch-1

    Adding title to README.md file.
    humblec authored Aug 14, 2020
    Copy the full SHA
    f858b9c View commit details

Commits on Jul 5, 2022

  1. Use latest fedora image

    Signed-off-by: black.dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Jul 5, 2022
    Copy the full SHA
    58b37f6 View commit details

Commits on Jul 7, 2022

  1. [centos] Use CentOS stream 9 along with Gluster9

    Gluster 10 is missing `tcmu-runner`. It'll be added in a few weeks and
    then we can update accordingly.
    
    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Jul 7, 2022
    Copy the full SHA
    226f21c View commit details
  2. [update-params] Update the script to work with unified cgroups

    Every unit can now have its own slice instead of global values like
    it used to be in V1. The script has been adjusted in accordance.
    
    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Jul 7, 2022
    Copy the full SHA
    1655340 View commit details

Commits on Jul 8, 2022

  1. [deploy] Use GH Actions to build and publish to GHCR

    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Jul 8, 2022
    Copy the full SHA
    8c5619b View commit details
  2. Don't use the lastest tag, use version instead

    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Jul 8, 2022
    Copy the full SHA
    3acec3e View commit details
  3. Merge pull request #181 from black-dragon74/f36-rawhide

    Use latest fedora image
    black-dragon74 authored Jul 8, 2022
    Copy the full SHA
    c5a59b7 View commit details

Commits on Jul 12, 2022

  1. Merge pull request #182 from black-dragon74/centos-stream9

    Bring CentOS container up to date
    black-dragon74 authored Jul 12, 2022
    Copy the full SHA
    ea4ffcd View commit details
  2. [centos] Add support for setting legacy cgroup pids

    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Jul 12, 2022
    Copy the full SHA
    86c1391 View commit details

Commits on Jul 13, 2022

  1. Merge pull request #184 from black-dragon74/legacy-cgroups

    [centos] Add support for setting legacy cgroup pids
    black-dragon74 authored Jul 13, 2022
    Copy the full SHA
    c98eefc View commit details
  2. [tests] Add tests for the container images

    Signed-off-by: black-dragon74 <niryadav@redhat.com>
    black-dragon74 committed Jul 13, 2022
    Copy the full SHA
    7911046 View commit details
  3. Make tests a bit more verbose

    Signed-off-by: black-dragon74 <niryadav@redhat.com>
    black-dragon74 committed Jul 13, 2022
    Copy the full SHA
    89ce8ce View commit details

Commits on Jul 15, 2022

  1. [action] Use GITHUB_KEY to authenticate the workflow

    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Jul 15, 2022
    Copy the full SHA
    4592336 View commit details
  2. [tests] Use temp dirs while testing and a few improvements

    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Jul 15, 2022
    Copy the full SHA
    6834036 View commit details
  3. Merge pull request #183 from black-dragon74/gh-action-deploy

    [deploy] Use GH Actions to build and publish to GHCR
    black-dragon74 authored Jul 15, 2022
    Copy the full SHA
    7dfa539 View commit details
  4. [docs] Update README to reflect new container registry

    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Jul 15, 2022
    Copy the full SHA
    9e718a0 View commit details
  5. Merge pull request #185 from black-dragon74/container-tests

    [tests] Add tests for the container images
    black-dragon74 authored Jul 15, 2022
    Copy the full SHA
    c7fc084 View commit details
  6. [docs] Fix image tag name in docker run

    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Jul 15, 2022
    Copy the full SHA
    251aa71 View commit details

Commits on Jul 18, 2022

  1. Merge pull request #187 from black-dragon74/update-docu

    [docs] Update README to reflect new container registry
    black-dragon74 authored Jul 18, 2022
    Copy the full SHA
    569e3be View commit details
  2. [deploy] Cleanup actions code and add arm64 support

    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Jul 18, 2022
    Copy the full SHA
    b2648e8 View commit details
  3. Fix typo in platform name

    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Jul 18, 2022
    Copy the full SHA
    fdc4a40 View commit details
  4. [actions] Run container and linter tests on PRs

    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Jul 18, 2022
    Copy the full SHA
    3fa832c View commit details
  5. Allow container script to be executed both by abs and relative paths

    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Jul 18, 2022
    Copy the full SHA
    cecc545 View commit details
  6. [tests] Enable TTY conditionally

    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Jul 18, 2022
    Copy the full SHA
    70c25f5 View commit details
  7. [tests] Bifercate tests into multiple steps

    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Jul 18, 2022
    Copy the full SHA
    14164cc View commit details
  8. [tests] Remove unnecessary TTY info

    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Jul 18, 2022
    Copy the full SHA
    d629d83 View commit details
  9. Merge pull request #188 from black-dragon74/gh-act-mpform

    [deploy] Cleanup actions code and add arm64 support
    humblec authored Jul 18, 2022
    Copy the full SHA
    767eb9f View commit details

Commits on Jul 19, 2022

  1. [tests] Remove chmod. File already has executable bit set

    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Jul 19, 2022
    Copy the full SHA
    e03d00d View commit details
  2. Merge pull request #189 from black-dragon74/gh-act-pr

    [actions] Run container and linter tests on PRs
    humblec authored Jul 19, 2022
    Copy the full SHA
    49ef134 View commit details

Commits on Jul 20, 2022

  1. [CI/CD] Remove old Travis CI artifacts

    We use GtiHub actions for all our CI/CD work now.
    
    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Jul 20, 2022
    Copy the full SHA
    0bae731 View commit details
  2. Copy the full SHA
    362ce92 View commit details
  3. Merge pull request #191 from gluster/lint-test-pr-comment

    Allow tests to be run by using `/test` in the comment
    black-dragon74 authored Jul 20, 2022
    Copy the full SHA
    69a9ec6 View commit details
  4. Merge pull request #190 from black-dragon74/rm-travis-ci

    [CI/CD] Remove old Travis CI artifacts
    mscherer authored Jul 20, 2022
    Copy the full SHA
    3e56647 View commit details

Commits on Jul 27, 2022

  1. [build] Publish new release only when the container's

    files are updated. The current job is triggered even when
    we change files like workflows and gitignore.
    
    Signed-off-by: black.dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Jul 27, 2022
    Copy the full SHA
    b1d2684 View commit details

Commits on Aug 4, 2022

  1. [Fedora] Remove extra systemd services from the container

    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Aug 4, 2022
    Copy the full SHA
    42f205e View commit details

Commits on Aug 8, 2022

  1. [centos] Use latest version of Glusterfs

    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Aug 8, 2022
    Copy the full SHA
    0508559 View commit details
  2. [centos] Group similar build steps into a single layer

    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Aug 8, 2022
    Copy the full SHA
    f8feabb View commit details
  3. Fix linter errors

    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Aug 8, 2022
    Copy the full SHA
    4ef57f2 View commit details

Commits on Aug 9, 2022

  1. Merge pull request #192 from black-dragon74/build-on-change

    [build] Publish new release only when the container's files are updated
    black-dragon74 authored Aug 9, 2022
    Copy the full SHA
    07d2f62 View commit details
  2. Cleanup artifcats after setting up services

    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Aug 9, 2022
    Copy the full SHA
    ff5efaf View commit details

Commits on Aug 16, 2022

  1. Remove external RPM install of gperftools

    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Aug 16, 2022
    Copy the full SHA
    4761b17 View commit details
  2. Merge pull request #194 from black-dragon74/centos-s9-g10

    [centos] Use latest version of Glusterfs
    humblec authored Aug 16, 2022
    Copy the full SHA
    f6d2900 View commit details
  3. Merge pull request #195 from black-dragon74/centos-opt-layers

    [centos] Group similar build steps into a single layer
    humblec authored Aug 16, 2022
    Copy the full SHA
    2c088fe View commit details

Commits on Aug 19, 2022

  1. Merge pull request #193 from black-dragon74/rm-systemd-extras

    [Fedora] Remove extra systemd services from the container
    black-dragon74 authored Aug 19, 2022
    Copy the full SHA
    cace136 View commit details

Commits on Aug 25, 2022

  1. [README] Update readme to reflect latest version and container tags

    Signed-off-by: black.dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Aug 25, 2022
    Copy the full SHA
    1094cce View commit details

Commits on Aug 31, 2022

  1. Copy the full SHA
    0aac6f1 View commit details

Commits on Oct 4, 2022

  1. [centos] Clean yum cache once we are done

    with installing and setting up packages. Cleaning it twice
    , once in the bginning and once in the end makes no sense as
    it could all be done in one go.
    
    This patch also saves us a couple of seconds due to the command
    being run only once.
    
    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Oct 4, 2022
    Copy the full SHA
    9f5b004 View commit details

Commits on Oct 11, 2022

  1. Merge pull request #198 from black-dragon74/yum-skip-cache-prune-twice

    [centos] Clean yum cache once we are done
    black-dragon74 authored Oct 11, 2022
    Copy the full SHA
    9d4ed75 View commit details

Commits on Oct 13, 2022

  1. [centos] Switch from yum to dnf

    Signed-off-by: black-dragon74 <nickk.2974@gmail.com>
    black-dragon74 committed Oct 13, 2022
    Copy the full SHA
    7742069 View commit details
64 changes: 64 additions & 0 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build and release Docker images

on:
push:
branches:
- "master"
paths:
- "CentOS/**"
- "Fedora/**"

env:
REGISTRY: ghcr.io
USER: ${{ github.actor }} # The GitHub user
PASSWORD: ${{ secrets.GITHUB_TOKEN }}
IMAGE_NAME: ${{ github.repository }} # xlates to <username>/<repo>

jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the current repo
- name: Checkout repository
uses: actions/checkout@v3

# Run the tests
- name: Run linter tests
run: |
sudo apt install shellcheck
sudo npm install -g dockerfile_lint
make
# Login to GitHub package registry with Docker
- name: Login to package registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.USER }}
password: ${{ env.PASSWORD }}

# Set up QEMU (multi-platform)
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

# Set up Docker buildx (multi-platform)
- name: Set up Docker BuildX
uses: docker/setup-buildx-action@v2

# Build and push CentOS image
- name: Build and push CentOS image for amd64 and arm64
uses: docker/build-push-action@v3
with:
push: true
context: ./CentOS
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:centos,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
platforms: linux/amd64,linux/arm64

# Build and push Fedora image
- name: Build and push Fedora image for amd64 and arm64
uses: docker/build-push-action@v3
with:
push: true
context: ./Fedora
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:fedora
platforms: linux/amd64,linux/arm64
39 changes: 39 additions & 0 deletions .github/workflows/lint-and-test-on-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Linter and Container tests

on:
issue_comment:
branches:
- "master"
types:
- "created"
- "edited"
- "deleted"

jobs:
lint_and_test:
if: |
contains(github.event.comment.html_url, '/pull/') &&
contains(github.event.comment.body, '/test')
runs-on: ubuntu-latest
steps:
# Checkout the current repo
- name: Checkout repository
uses: actions/checkout@v3

# Prepare the runner
- name: Prepare the runner
run: |
sudo apt install shellcheck
sudo npm install -g dockerfile_lint
# Run the linter tests
- name: Run linter tests
run: make

# Run the container tests for CentOS
- name: Run CentOS container tests
run: tests/container-tests.sh centos

# Run the container tests for Fedora
- name: Run Fedora container tests
run: tests/container-tests.sh fedora
32 changes: 32 additions & 0 deletions .github/workflows/lint-and-test-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Linter and Container tests

on:
pull_request:
branches:
- "master"

jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the current repo
- name: Checkout repository
uses: actions/checkout@v3

# Prepare the runner
- name: Prepare the runner
run: |
sudo apt install shellcheck
sudo npm install -g dockerfile_lint
# Run the linter tests
- name: Run linter tests
run: make

# Run the container tests for CentOS
- name: Run CentOS container tests
run: tests/container-tests.sh centos

# Run the container tests for Fedora
- name: Run Fedora container tests
run: tests/container-tests.sh fedora
54 changes: 0 additions & 54 deletions .travis.yml

This file was deleted.

69 changes: 24 additions & 45 deletions CentOS/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM centos:7
FROM quay.io/centos/centos:stream9

MAINTAINER Humble Chirammal hchiramm@redhat.com Saravanakumar Arumugam sarumuga@redhat.com

@@ -15,7 +15,7 @@ LABEL architecture="$ARCH" \
description="Gluster Image is based on CentOS Image which is a scalable network filesystem. Using common off-the-shelf hardware, you can create large, distributed storage solutions for media streaming, data analysis, and other data- and bandwidth-intensive tasks." \
io.openshift.tags="gluster,glusterfs,glusterfs-centos"

RUN yum --setopt=tsflags=nodocs -y update && yum install -y centos-release-gluster && yum clean all && \
RUN dnf --nodocs -y update && dnf --nodocs -y install centos-release-gluster && \
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done) && \
rm -f /lib/systemd/system/multi-user.target.wants/* &&\
rm -f /etc/systemd/system/*.wants/* &&\
@@ -24,21 +24,21 @@ rm -f /lib/systemd/system/sockets.target.wants/*udev* && \
rm -f /lib/systemd/system/sockets.target.wants/*initctl* && \
rm -f /lib/systemd/system/basic.target.wants/* &&\
rm -f /lib/systemd/system/anaconda.target.wants/* &&\
yum --setopt=tsflags=nodocs -y install nfs-utils && \
yum --setopt=tsflags=nodocs -y install attr && \
yum --setopt=tsflags=nodocs -y install iputils && \
yum --setopt=tsflags=nodocs -y install iproute && \
yum --setopt=tsflags=nodocs -y install openssh-server && \
yum --setopt=tsflags=nodocs -y install openssh-clients && \
yum --setopt=tsflags=nodocs -y install rsync && \
yum --setopt=tsflags=nodocs -y install tar && \
yum --setopt=tsflags=nodocs -y install cronie && \
yum --setopt=tsflags=nodocs -y install xfsprogs && \
yum --setopt=tsflags=nodocs -y install glusterfs && \
yum --setopt=tsflags=nodocs -y install glusterfs-server && \
yum --setopt=tsflags=nodocs -y install glusterfs-rdma && \
yum --setopt=tsflags=nodocs -y install gluster-block && \
yum --setopt=tsflags=nodocs -y install glusterfs-geo-replication && yum clean all && \
dnf --nodocs -y install nfs-utils && \
dnf --nodocs -y install attr && \
dnf --nodocs -y install iputils && \
dnf --nodocs -y install iproute && \
dnf --nodocs -y install openssh-server && \
dnf --nodocs -y install openssh-clients && \
dnf --nodocs -y install rsync && \
dnf --nodocs -y install tar && \
dnf --nodocs -y install cronie && \
dnf --nodocs -y install xfsprogs && \
dnf --nodocs -y install glusterfs && \
dnf --nodocs -y install glusterfs-server && \
dnf --nodocs -y install glusterfs-rdma && \
dnf --nodocs -y install gluster-block && \
dnf --nodocs -y install glusterfs-geo-replication && dnf clean all && \
sed -i '/Port 22/c\Port 2222' /etc/ssh/sshd_config && \
sed -i 's/Requires\=rpcbind\.service//g' /usr/lib/systemd/system/glusterd.service && \
sed -i 's/rpcbind\.service/gluster-setup\.service/g' /usr/lib/systemd/system/glusterd.service && \
@@ -89,35 +89,14 @@ RUN true \


VOLUME [ "/sys/fs/cgroup" ]
ADD gluster-fake-disk.service /etc/systemd/system/gluster-fake-disk.service
ADD fake-disk.sh /usr/libexec/gluster/fake-disk.sh
ADD gluster-setup.service /etc/systemd/system/gluster-setup.service
ADD gluster-setup.sh /usr/sbin/gluster-setup.sh
ADD gluster-block-setup.service /etc/systemd/system/gluster-block-setup.service
ADD gluster-block-setup.sh /usr/sbin/gluster-block-setup.sh
ADD update-params.sh /usr/local/bin/update-params.sh
ADD status-probe.sh /usr/local/bin/status-probe.sh
ADD tcmu-runner-params /etc/sysconfig/tcmu-runner-params
ADD gluster-check-diskspace.service /etc/systemd/system/gluster-check-diskspace.service
ADD check_diskspace.sh /usr/local/bin/check_diskspace.sh
ADD exec-on-host.sh /usr/sbin/exec-on-host

RUN chmod 644 /etc/systemd/system/gluster-setup.service && \
chmod 644 /etc/systemd/system/gluster-check-diskspace.service && \
chmod 755 /usr/libexec/gluster/fake-disk.sh && \
chmod 500 /usr/sbin/gluster-setup.sh && \
chmod 644 /etc/systemd/system/gluster-block-setup.service && \
chmod 500 /usr/sbin/gluster-block-setup.sh && \
chmod +x /usr/local/bin/update-params.sh && \
chmod +x /usr/local/bin/status-probe.sh && \
chmod +x /usr/local/bin/check_diskspace.sh && \
systemctl disable nfs-server.service && \
systemctl enable gluster-fake-disk.service && \
systemctl enable gluster-setup.service && \
systemctl enable gluster-block-setup.service && \
systemctl enable gluster-blockd.service && \
systemctl enable glusterd.service && \
systemctl enable gluster-check-diskspace.service
COPY . /tmp/container-setup
RUN true \
&& cd /tmp/container-setup \
&& ./setup-services.sh \
&& cd - \
&& rm -rf /tmp/container-setup \
&& true

EXPOSE 2222 111 245 443 24007 2049 8080 6010 6011 6012 38465 38466 38468 38469 49152 49153 49154 49156 49157 49158 49159 49160 49161 49162

40 changes: 40 additions & 0 deletions CentOS/setup-services.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

# verbose and exit on error
set -ex

# Copy files to required locations
cp gluster-fake-disk.service /etc/systemd/system/gluster-fake-disk.service
mkdir -p /usr/libexec/gluster
cp fake-disk.sh /usr/libexec/gluster/fake-disk.sh
cp gluster-setup.service /etc/systemd/system/gluster-setup.service
cp gluster-setup.sh /usr/sbin/gluster-setup.sh
cp gluster-block-setup.service /etc/systemd/system/gluster-block-setup.service
cp gluster-block-setup.sh /usr/sbin/gluster-block-setup.sh
cp update-params.sh /usr/local/bin/update-params.sh
cp status-probe.sh /usr/local/bin/status-probe.sh
cp tcmu-runner-params /etc/sysconfig/tcmu-runner-params
cp gluster-check-diskspace.service /etc/systemd/system/gluster-check-diskspace.service
cp check_diskspace.sh /usr/local/bin/check_diskspace.sh
cp exec-on-host.sh /usr/sbin/exec-on-host


# Set required bits
chmod 644 /etc/systemd/system/gluster-setup.service
chmod 644 /etc/systemd/system/gluster-check-diskspace.service
chmod 755 /usr/libexec/gluster/fake-disk.sh
chmod 500 /usr/sbin/gluster-setup.sh
chmod 644 /etc/systemd/system/gluster-block-setup.service
chmod 500 /usr/sbin/gluster-block-setup.sh
chmod +x /usr/local/bin/update-params.sh
chmod +x /usr/local/bin/status-probe.sh
chmod +x /usr/local/bin/check_diskspace.sh

# Bootstrap services
systemctl disable nfs-server.service
systemctl enable gluster-fake-disk.service
systemctl enable gluster-setup.service
systemctl enable gluster-block-setup.service
systemctl enable gluster-blockd.service
systemctl enable glusterd.service
systemctl enable gluster-check-diskspace.service
36 changes: 36 additions & 0 deletions CentOS/update-params.sh
Original file line number Diff line number Diff line change
@@ -10,6 +10,23 @@
: ${TCMU_LOCKDIR:=/var/run/lock}

set_cgroup_pids() {
# Check if system is using unified cgroups i.e. v2
# We can cat /proc/filesystems, it'll have an entry for cgroups v2
# But systemd already does this for us, so we can just query it.
cgroupVer=$(systemctl show -all | grep -o "default-hierarchy.*" | cut -d '=' -f2)

# Call relevant functions, v2 is for unified, v1 is for legacy cgroups
if [[ "${cgroupVer}" == "unified" ]]
then
echo "Systemd is using unified cgroups(v2)"
set_cgroup_pids_v2 $1
else
echo "Systemd is using legacy cgroups(v1)"
set_cgroup_pids_v1 $1
fi
}

set_cgroup_pids_v1() {
local ret=0
local pids=$1
local cgroup max
@@ -28,6 +45,25 @@ set_cgroup_pids() {
return ${ret}
}

set_cgroup_pids_v2() {
local ret=0
local pids=$1
local cgroup max

cgroup=$(awk -F: '{print $3}' /proc/self/cgroup)

max=$(cat /sys/fs/cgroup/"${cgroup}"/pids.max)
echo "maximum number of pids configured in cgroups: ${max}"

echo "${pids}" > /sys/fs/cgroup/"${cgroup}"/pids.max
ret=$?

max=$(cat /sys/fs/cgroup/"${cgroup}"/pids.max)
echo "maximum number of pids configured in cgroups (reconfigured): ${max}"

return ${ret}
}

# do not change cgroup/pids when CGROUP_PIDS_MAX is set to 0
if [[ "${CGROUP_PIDS_MAX}" != '0' ]]
then
Loading