aws / aws-codedeploy-agent

Host Agent for AWS CodeDeploy
https://aws.amazon.com/codedeploy
Apache License 2.0
328 stars 188 forks source link

Debian package depends on ruby version < 3.1, even though 3.1 and 3.2 is supported #371

Open anderscarling opened 1 year ago

anderscarling commented 1 year ago

Since 1.6.0 ruby 3.1 and 3.2 is supported, but the .deb package depends on an older ruby version being present:

Package: codedeploy-agent
Version: 1.6.0-49
Architecture: all
Depends: ruby2.0 | ruby2.1 | ruby2.2 | ruby2.3 | ruby2.4 | ruby2.5 | ruby2.6 | ruby2.7 | ruby3.0
Section: admin
Maintainer: Amazon Web Services
Description: CodeDeploy instance agent is responsible for doing the actual work of deploying software on an EC2 instance.

For our deployment scenario it would be great if we could just run with 3.1 or 3.2 installed on the system, not having to install an older version.

julien3 commented 1 year ago

For instance, CodeDeploy can't be installed on a Debian 12 (bookworm) machine, default ruby version is 3.1.

marcelrouw commented 1 year ago

We are running into the same issue with Debian 12. Only we installed our own version of ruby 3.1 with rvm.

Debian 11 and ruby 3.0 uses openssl 1.1.1 and openssl 1.1.1 is EOF on 11 Sep 2023. So we like to move to Debian 12 and ruby 3.1 which both uses openssl 3.x

Url to download install script: https://aws-codedeploy-eu-central-1.s3.eu-central-1.amazonaws.com/latest/install

The install script seems to allow ruby 3.1 and 3.2 but the codedeploy-agent_1.6.0-49_all.tmp-20230811-22192-e74tpq.deb doesn't allow ruby 3.1. and 3.2

admin@ip-xxx-xxx-xxx-xxx:/tmp$ sudo ./install auto I, [2023-08-11T18:02:26.243905 #22192] INFO -- : Starting Ruby version check. I, [2023-08-11T18:02:26.244114 #22192] INFO -- : Starting update check. I, [2023-08-11T18:02:26.244195 #22192] INFO -- : Attempting to automatically detect supported package manager type for system... I, [2023-08-11T18:02:26.265502 #22192] INFO -- : Checking AWS_REGION environment variable for region information... I, [2023-08-11T18:02:26.265603 #22192] INFO -- : Checking EC2 metadata service for region information... I, [2023-08-11T18:02:26.284724 #22192] INFO -- : Checking AWS_DOMAIN environment variable for domain information... I, [2023-08-11T18:02:26.285047 #22192] INFO -- : Checking EC2 metadata service for domain information... I, [2023-08-11T18:02:26.289072 #22192] INFO -- : Downloading version file from bucket aws-codedeploy-eu-central-1 and key latest/LATEST_VERSION... I, [2023-08-11T18:02:26.289489 #22192] INFO -- : Endpoint: https://aws-codedeploy-eu-central-1.s3.eu-central-1.amazonaws.com/latest/LATEST_VERSION dpkg-query: package 'codedeploy-agent' is not installed and no information is available Use dpkg --info (= dpkg-deb --info) to examine archive files. I, [2023-08-11T18:02:26.390208 #22192] INFO -- : Running version No running version I, [2023-08-11T18:02:26.390814 #22192] INFO -- : Downloading package from bucket aws-codedeploy-eu-central-1 and key releases/codedeploy-agent_1.6.0-49_all.deb... I, [2023-08-11T18:02:26.391069 #22192] INFO -- : Endpoint: https://aws-codedeploy-eu-central-1.s3.eu-central-1.amazonaws.com/releases/codedeploy-agent_1.6.0-49_all.deb I, [2023-08-11T18:02:26.541416 #22192] INFO -- : Executing /usr/bin/gdebi -n -o Dpkg::Options::=--force-confdef -o Dkpg::Options::=--force-confold /tmp/codedeploy-agent_1.6.0-49_all.tmp-20230811-22192-e74tpq.deb... Reading package lists... Done Building dependency tree... Done Reading state information... Done Reading state information... Done This package is uninstallable Dependency is not satisfiable: ruby2.0|ruby2.1|ruby2.2|ruby2.3|ruby2.4|ruby2.5|ruby2.6|ruby2.7|ruby3.0

E, [2023-08-11T18:02:27.317421 #22192] ERROR -- : Error installing /tmp/codedeploy-agent_1.6.0-49_all.tmp-20230811-22192-e74tpq.deb. admin@ip-xxx-xxx-xxx-xxx:/tmp$ which ruby /usr/local/rvm/rubies/ruby-3.1.4/bin/ruby admin@ip-xxx-xxx-xxx-xxx:/tmp$ ruby -v ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]

marcelrouw commented 12 months ago

AWS support told me to create a new feature request for Debian 12 Bookworm support. So I did. Please vote: https://github.com/aws/aws-codedeploy-agent/issues/375

julien3 commented 12 months ago

The deb package is just missing | ruby3.1 | ruby3.2 in its control file, in the depends section.

Until AWS fix their packaging process and if you really need Debian 12 support now, you can either build the project or just repackage the deb.

Here's a quick snippet to add to the install script that does repackage the deb on the go (add this just before install_cmd << package_file.path, in the install_from_s3 function, for example with sed, ansible...): https://gist.github.com/julien3/f4032bd5a0754ea4e0d212e1b95e918a All it does is using dpkg-deb to unpack/repack and sed to add the missing ruby versions to the control file.

NicosGollan-cnic commented 11 months ago

Looking at the state of the repository, neither main nor the 1.6.x branch are compatible with Ruby 3.2 and would need at least updates to required gems.