From 7a53d06c2c7cba7433709d8ea719728d6803d067 Mon Sep 17 00:00:00 2001 From: Dmytro Zghoba Date: Thu, 13 Jun 2024 16:55:48 +0200 Subject: [PATCH 1/4] fix external restore --- cmd/pbm-agent/restore.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/pbm-agent/restore.go b/cmd/pbm-agent/restore.go index 6ba38f150..d12f21cee 100644 --- a/cmd/pbm-agent/restore.go +++ b/cmd/pbm-agent/restore.go @@ -397,6 +397,7 @@ func (a *Agent) Restore(ctx context.Context, r *ctrl.RestoreCmd, opid ctrl.OPID, return } bcpType = bcp.Type + r.BackupName = bcp.Name } l.Info("recovery started") @@ -429,7 +430,6 @@ func (a *Agent) Restore(ctx context.Context, r *ctrl.RestoreCmd, opid ctrl.OPID, return } - r.BackupName = bcp.Name err = rstr.Snapshot(ctx, r, r.OplogTS, opid, l, a.closeCMD, a.HbPause) } if err != nil { From e189b5b78254eddd1039bd488743d00f49ab2f3e Mon Sep 17 00:00:00 2001 From: Dmytro Zghoba Date: Thu, 13 Jun 2024 18:32:53 +0200 Subject: [PATCH 2/4] Revert "fix external restore" This reverts commit 7a53d06c2c7cba7433709d8ea719728d6803d067. --- cmd/pbm-agent/restore.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/pbm-agent/restore.go b/cmd/pbm-agent/restore.go index d12f21cee..6ba38f150 100644 --- a/cmd/pbm-agent/restore.go +++ b/cmd/pbm-agent/restore.go @@ -397,7 +397,6 @@ func (a *Agent) Restore(ctx context.Context, r *ctrl.RestoreCmd, opid ctrl.OPID, return } bcpType = bcp.Type - r.BackupName = bcp.Name } l.Info("recovery started") @@ -430,6 +429,7 @@ func (a *Agent) Restore(ctx context.Context, r *ctrl.RestoreCmd, opid ctrl.OPID, return } + r.BackupName = bcp.Name err = rstr.Snapshot(ctx, r, r.OplogTS, opid, l, a.closeCMD, a.HbPause) } if err != nil { From 42203c90573e0ee1a050d642a9ae0b4db8678376 Mon Sep 17 00:00:00 2001 From: Oleksandr Miroshnychenko Date: Tue, 21 May 2024 15:03:51 +0300 Subject: [PATCH 3/4] test cirrus ci tagging --- .cirrus.yml | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .cirrus.yml diff --git a/.cirrus.yml b/.cirrus.yml new file mode 100644 index 000000000..a402145ac --- /dev/null +++ b/.cirrus.yml @@ -0,0 +1,69 @@ +script_template: &SCRIPT_TEMPLATE + system_info_script: | + uname -r + uname -i + df -Th + free -m + pwd + ls -l .. + nproc --all + cat /proc/cpuinfo + install_dependencies_script: | + export DEBIAN_FRONTEND=noninteractive + PACKAGES_TO_INSTALL="lz4 unzip" + apt update + apt -yq --no-install-suggests --no-install-recommends --allow-unauthenticated install $PACKAGES_TO_INSTALL + if ! $(aws --version | grep -q 'aws-cli/2'); then + find /tmp -maxdepth 1 -name "*aws*" | xargs sudo rm -rf + + until curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "/tmp/awscliv2.zip"; do + sleep 1 + echo try again + done + + unzip -o /tmp/awscliv2.zip -d /tmp + cd /tmp/aws && sudo ./install + fi + set_additional_tags_script: | + TOKEN=$(curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600") + echo $TOKEN + INSTANCE_ID=$(curl -s -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/instance-id) + echo $INSTANCE_ID + AZ=$(curl -s -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/placement/availability-zone) + echo $AZ + REGION=$(echo $AZ | sed 's/[a-z]$//') + aws --version + sleep 5 + aws ec2 describe-tags --filters "Name=resource-id,Values=$INSTANCE_ID" --region=$REGION || true + aws ec2 describe-tags --filters "Name=resource-id,Values=$INSTANCE_ID" --region=$REGION || true + aws ec2 describe-instances --instance-ids $INSTANCE_ID --region=$REGION || true + aws sts get-caller-identity || true + aws ec2 associate-iam-instance-profile --instance-id $INSTANCE_ID --iam-instance-profile Name=jenkins-ps80-master || true + sleep 3600 + + +task: + name: "Test tags" + aws_credentials: ENCRYPTED[3dec7f4eb176b0bde14de840ddf9c356de3a739bd7ae14fcb9751c38afc96dd2f39c25853e6934cfff5c8e433c1d98e5] + ec2_instance: + image: ami-0cf2b4e024cdb6960 # Replace with your desired AMI ID + type: c5.large # Specify the instance type you want to use + region: us-west-2 # Define the region where the instance will be launched + key_name: jenkins-master # Optionally specify a key pair for SSH access + spot: true + tags: + - key: Name + value: test + - key: Cirrusci + value: test-tag + - key: iit-billing-tag + value: CirrusCI + security_groups: + - default # Specify security groups + block_device_mappings: + - device_name: /dev/sda1 + ebs: + volume_size: 20 # Size of the EBS volume in GB + script: | + uname -a + << : *SCRIPT_TEMPLATE From d17d2557ae55f18c3922cc28858de6f29ed88327 Mon Sep 17 00:00:00 2001 From: Oleksandr Miroshnychenko Date: Wed, 28 Aug 2024 09:19:18 +0300 Subject: [PATCH 4/4] PKG-157 pbm: add marketing message to postinstall --- .cirrus.yml | 69 ------------------------------- packaging/debian/postinst | 10 +++++ packaging/rpm/mongodb-backup.spec | 10 +++++ 3 files changed, 20 insertions(+), 69 deletions(-) delete mode 100644 .cirrus.yml diff --git a/.cirrus.yml b/.cirrus.yml deleted file mode 100644 index a402145ac..000000000 --- a/.cirrus.yml +++ /dev/null @@ -1,69 +0,0 @@ -script_template: &SCRIPT_TEMPLATE - system_info_script: | - uname -r - uname -i - df -Th - free -m - pwd - ls -l .. - nproc --all - cat /proc/cpuinfo - install_dependencies_script: | - export DEBIAN_FRONTEND=noninteractive - PACKAGES_TO_INSTALL="lz4 unzip" - apt update - apt -yq --no-install-suggests --no-install-recommends --allow-unauthenticated install $PACKAGES_TO_INSTALL - if ! $(aws --version | grep -q 'aws-cli/2'); then - find /tmp -maxdepth 1 -name "*aws*" | xargs sudo rm -rf - - until curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "/tmp/awscliv2.zip"; do - sleep 1 - echo try again - done - - unzip -o /tmp/awscliv2.zip -d /tmp - cd /tmp/aws && sudo ./install - fi - set_additional_tags_script: | - TOKEN=$(curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600") - echo $TOKEN - INSTANCE_ID=$(curl -s -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/instance-id) - echo $INSTANCE_ID - AZ=$(curl -s -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/placement/availability-zone) - echo $AZ - REGION=$(echo $AZ | sed 's/[a-z]$//') - aws --version - sleep 5 - aws ec2 describe-tags --filters "Name=resource-id,Values=$INSTANCE_ID" --region=$REGION || true - aws ec2 describe-tags --filters "Name=resource-id,Values=$INSTANCE_ID" --region=$REGION || true - aws ec2 describe-instances --instance-ids $INSTANCE_ID --region=$REGION || true - aws sts get-caller-identity || true - aws ec2 associate-iam-instance-profile --instance-id $INSTANCE_ID --iam-instance-profile Name=jenkins-ps80-master || true - sleep 3600 - - -task: - name: "Test tags" - aws_credentials: ENCRYPTED[3dec7f4eb176b0bde14de840ddf9c356de3a739bd7ae14fcb9751c38afc96dd2f39c25853e6934cfff5c8e433c1d98e5] - ec2_instance: - image: ami-0cf2b4e024cdb6960 # Replace with your desired AMI ID - type: c5.large # Specify the instance type you want to use - region: us-west-2 # Define the region where the instance will be launched - key_name: jenkins-master # Optionally specify a key pair for SSH access - spot: true - tags: - - key: Name - value: test - - key: Cirrusci - value: test-tag - - key: iit-billing-tag - value: CirrusCI - security_groups: - - default # Specify security groups - block_device_mappings: - - device_name: /dev/sda1 - ebs: - volume_size: 20 # Size of the EBS volume in GB - script: | - uname -a - << : *SCRIPT_TEMPLATE diff --git a/packaging/debian/postinst b/packaging/debian/postinst index b89f8ad41..0598396ba 100644 --- a/packaging/debian/postinst +++ b/packaging/debian/postinst @@ -2,4 +2,14 @@ #DEBHELPER# chown mongod:mongod /etc/pbm-storage.conf +cat << EOF +** Join Percona Squad! ** + +Participate in monthly SWAG raffles, get early access to new product features, +invite-only ”ask me anything” sessions with database performance experts. + +Interested? Fill in the form at https://squad.percona.com/mongodb + +EOF + exit 0 diff --git a/packaging/rpm/mongodb-backup.spec b/packaging/rpm/mongodb-backup.spec index 28e7d117a..a8b1cdf38 100644 --- a/packaging/rpm/mongodb-backup.spec +++ b/packaging/rpm/mongodb-backup.spec @@ -110,6 +110,16 @@ fi fi %endif +cat << EOF +** Join Percona Squad! ** + +Participate in monthly SWAG raffles, get early access to new product features, +invite-only ”ask me anything” sessions with database performance experts. + +Interested? Fill in the form at https://squad.percona.com/mongodb + +EOF + %postun -n percona-backup-mongodb case "$1" in