Test #33
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: [workflow_dispatch] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Checkout Repo' | |
uses: actions/checkout@v2 | |
- name: cat | |
run: cat test.json | |
- name: 'CGroup' | |
run: | | |
sudo cgrulesengd || true | |
cgconfigparser --load=/etc/cgconfig.conf || true | |
# print out config file | |
cat /etc/cgconfig.conf || true | |
- name: 'CGroup2' | |
run: | | |
sudo mkdir /etc/cgconfig.d || true | |
sudo cp /etc/cgconfig.conf /etc/cgconfig.d/ || true | |
cgconfigparser --load=/etc/cgconfig.conf || true | |
echo 'cgrules.conf:' | |
cat /etc/cgrules.conf | |
echo 'daemon.json:' | |
cat /etc/docker/daemon.json | |
- name: OOM | |
run: | | |
if [ -d "/mnt" ]; then | |
echo "/mnt directory does exist." | |
sudo swapoff /mnt/swapfile | |
# Create a 2GB swapfile under the root directory (/) | |
echo "Creating a 2GB swapfile..." | |
sudo fallocate -l 2G /swapfile | |
# Set permissions | |
sudo chmod 600 /swapfile | |
# Make the file usable as swap | |
sudo mkswap /swapfile | |
# Enable the swapfile | |
sudo swapon /swapfile | |
echo "Swapfile created and enabled successfully." | |
else | |
echo "/mnt directory doesn't exists." | |
fi | |
# Get the PID of the 'provisioner' process | |
PROVISIONER_PID=$(pgrep provisioner) | |
# Change the oom_score_adj value to -1000 | |
echo -1000 | sudo tee /proc/$PROVISIONER_PID/oom_score_adj | |
# Check the current oom_score_adj value | |
echo "Current oom_score_adj value for provisioner: $(cat /proc/$PROVISIONER_PID/oom_score_adj)" | |