Comment 22 for bug 2023924

Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

I went ahead and tested the proposed package for Lunar/Kinetic/Jammy/Focal. The results are good. The testing steps are very similar for all releases so I'll make a single comment and highlight the small changes between them.

I tested the following packages:
Lunar - 1.0.0-0ubuntu13.2
Kinetic - 1.0.0-0ubuntu12.2
Jammy - 1.0.0-0ubuntu11.22.04.3
Focal - 1.0.0-0ubuntu9.4

1) Create AWS instance like so:
aws ec2 run-instances \
 --region ${AWS_REGION} \
 --image-id ${AWS_AMI} \
 --count 1 \
 --instance-type t3.micro \
 --key-name ${AWS_KEY} \
 --metadata-options "HttpTokens=required" \
 --security-group-ids ${AWS_SECURITY_GROUP} \
 --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=test-hibinit-${RELEASE}}]' \
 --block-device-mappings '[{"DeviceName":"/dev/sda1","Ebs":{"Encrypted":true,"DeleteOnTermination":true,"VolumeSize":8,"VolumeType":"gp2"}}]' \
 --hibernation-options 'Configured=true'

Following AMIs were used:
images=(
  "ami-095495524a76a487a lunar"
  "ami-070f3a579ee524cc4 kinetic"
  "ami-086178f8d4f1d44a2 jammy"
  "ami-00ab811808de193f8 focal"
)

2) ssh to system & update
$ sudo apt update -y && sudo apt upgrade -y
...
$ file /\"/var/lib/hibinit-agent\"/
/"/var/lib/hibinit-agent"/: directory

3) update to proposed package
$ echo "deb http://archive.ubuntu.com/ubuntu/ $(lsb_release -cs)-proposed restricted main multiverse universe" | sudo tee /etc/apt/sources.list.d/ubuntu-$(lsb_release -cs)-proposed.list
$ sudo apt update -y && sudo apt upgrade -y

4) test proposed package
# For Lunar I had to specify the version like so:
# sudo apt install ec2-hibinit-agent=1.0.0-0ubuntu13.2
$ file /\"/var/lib/hibinit-agent\"/
/"/var/lib/hibinit-agent"/: cannot open `/"/var/lib/hibinit-agent"/' (No such file or directory)

In addition to this, I tested the hibernation functionality of the utility to ensure no regressions.
1) Create a program to run continuously and run it
/bin/cat <<EOM >~/allocate_mem.py
#!/usr/bin/python3
import time

# Allocate 200MB chunk of memory
size = 200 * 1024 * 1024 # 200MB
memory_chunk = bytearray(size)

print("Allocated 200MB of memory.")

# Enter indefinite loop
while True:
    time.sleep(1) # Wait for 1 second

# The script will never reach this point
EOM
python3 ~/allocate_mem.py &
2) hibernate instance, and then resume instance
3) check for process still running
$ ps aux | grep allocate_mem | grep -v grep
ubuntu 2151 0.1 22.1 220644 210992 ? S 20:08 0:00 python3 /home/ubuntu/allocate_mem.py