-
Notifications
You must be signed in to change notification settings - Fork 186
Support for ruby 2.5 (Ubuntu 18.04) #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I've trudged along a little bit with this and found that installing it from git appears to work on a clean Ubuntu 18.04 instance (AMI ID: ami-0b91bd72)
At least it builds and the tests passes.
|
Hi @carlnordenfelt, I was able to get aws-codedeploy-agent running on Ubuntu Bionic working using your idea to install the gems using bundler. Here is a snippet of what I used. I haven't had a chance to do a codedeploy release yet, so I can't verify if all the Lifecycle hooks work fine. # Install aws-codedeploy-agent and required gems
sudo apt-get install -y git
codedeploy_git_url='https://github.com/aws/aws-codedeploy-agent.git'
git clone "$codedeploy_git_url"
sudo gem install bundler
sudo mv aws-codedeploy-agent /opt/codedeploy-agent
cd /opt/codedeploy-agent
bundle install --system
# Setup permissions
sudo chown -R root.root /opt/codedeploy-agent
sudo chmod 644 /opt/codedeploy-agent/conf/codedeployagent.yml
sudo chmod 755 /opt/codedeploy-agent/init.d/codedeploy-agent
sudo chmod 644 /opt/codedeploy-agent/init.d/codedeploy-agent.service
# Create symlink to match ./install setup
sudo mkdir -p /etc/codedeploy-agent
sudo ln -s /opt/codedeploy-agent/conf /etc/codedeploy-agent/conf
# Move init scripts
sudo mv /opt/codedeploy-agent/init.d/codedeploy-agent /etc/init.d/codedeploy-agent
sudo mv /opt/codedeploy-agent/init.d/codedeploy-agent.service \
/lib/systemd/system/codedeploy-agent.service
# Delete RHEL init info since this is for Ubuntu Bionic
sudo sed -i.bak '2,8d' /etc/init.d/codedeploy-agent && \
sudo rm -f /etc/init.d/codedeploy-agent.bak
# Enable init.d scripts to start at boot
sudo /etc/init.d/codedeploy-agent start && echo ''
sudo /usr/sbin/update-rc.d codedeploy-agent defaults
sudo /usr/sbin/update-rc.d codedeploy-agent enable
# Cleanup
files=(.git
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Gemfile.lock
LICENSE
NOTICE
README.md
Rakefile
buildspec-agent-rake.yml
coverage
deployment
features
spec
test)
cd /opt/codedeploy-agent
for f in "${files[@]}";do
sudo rm -rf "$f"
done |
installing 2.4 via rvm only partially works, it fails later with I, [2018-06-05T23:53:19.422673 #14835] INFO -- : Executing `/usr/bin/gdebi -n -o Dpkg::Options::=--force-confdef -o Dkpg::Options::=--force-confold /tmp/codedeploy-agent_1.0-1.1458_all.tmp-20180605-14835-coa00t.deb`...
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading state information... Done
This package is uninstallable
Dependency is not satisfiable: ruby2.0|ruby2.1|ruby2.2|ruby2.3
E, [2018-06-05T23:53:20.638750 #14835] ERROR -- : Error installing /tmp/codedeploy-agent_1.0-1.1458_all.tmp-20180605-14835-coa00t.deb. |
@salmonte your script worked perfect without any modifications for my Ubuntu 18.04 in AWS, even confirmed codedeploy was able to deploy to the instance afterward and the lifecycle hooks worked fine for me. |
+1 on this request |
Would anyone happened that errors are not shown in the deployments? |
I've noticed that it only copies folders properly in the "files" section of the appspec.yml file. Files are incorrectly marked as folders, and unreadable. |
After 2 days of testing I managed to make it work in a clean installation of Ubuntu 18 with rvm:
|
Another idea to get codedeploy-agent running on Ubuntu 18.04 (bionic): # remove ruby 2.5/rake if installed
apt purge libruby ruby rake
# add repositories for xenial and xenial-updates
cat << EOF > /etc/apt/sources.list.d/xenial.list
deb http://archive.ubuntu.com/ubuntu/ xenial main
deb http://archive.ubuntu.com/ubuntu/ xenial-updates main
EOF
# priorise ruby/rake from xenial repository
cat << EOF > /etc/apt/preferences.d/ruby-xenial
Package: ruby
Pin: release v=16.04, l=Ubuntu
Pin-Priority: 1024
Package: rake
Pin: release v=16.04, l=Ubuntu
Pin-Priority: 1024
EOF
# install ruby and dependent packages
apt update
apt install ruby gdebi-core
# download and run codedeploy-agent installer
curl -o /tmp/codedeploy-installer https://aws-codedeploy-eu-west-1.s3.amazonaws.com/latest/install
chmod +x /tmp/codedeploy-installer
/tmp/codedeploy-installer auto
# delete installer script
rm -f /tmp/codedeploy-installer
# create systemd service file and enable it
mv /etc/init.d/codedeploy-agent.service /lib/systemd/system/codedeploy-agent.service
systemctl enable codedeploy-agent.service This approach ensures that your system is receiving security updates for ruby, and this won't break anything (unless any of your applications require ruby >= 2.4). Also, this uses "official" stable releases of the AWS CodeDeploy agent. |
Trying to setup the codedeploy-agent on a new 18.04 image using rodrigodev94's method, and the GPG server is returning connection timed out. Are there options to install it without needing to validate the keys? Or just confirmation that they key agent here isn't failing? |
I created fake package (ruby2.3) and modify install script to workaround this issue:
|
any chance to fix that one ? |
Ubuntu 18.04 has released in April. But this agent is not supporting it now. It's too late. |
Any news on this? |
+1 to the request |
+1 it is a shame that AWS supports Ubuntu 18.04LTS officially from their repository and quick launch page, the 18.04 is out for 5 months BUT nobody is there from 10k+ engineers who could fix it. |
Hi @rohkat-aws, |
Yes its , but the agent needs to released . Will keep the issue open till we dont start releasing it. |
When will be released? |
#!/bin/bash
apt update
apt install ruby -y
gem install bundler
git clone https://github.com/aws/aws-codedeploy-agent.git /opt/codedeploy-agent
sudo chown -R root.root /opt/codedeploy-agent
sudo chmod 644 /opt/codedeploy-agent/conf/codedeployagent.yml
sudo chmod 755 /opt/codedeploy-agent/init.d/codedeploy-agent
sudo chmod 644 /opt/codedeploy-agent/init.d/codedeploy-agent.service
cd /opt/codedeploy-agent
bundle install --system
rake clean && rake
cp /opt/codedeploy-agent/init.d/codedeploy-agent /etc/init.d/
systemctl daemon-reload
systemctl start codedeploy-agent
systemctl enable codedeploy-agent I compose the @salmonte and @ghost scripts. @vetermanve oops I fixed it up. Thanks 👍 |
You missed first slash in |
Hello All, I had the same issues and after battling for almost 2 days, i finally raised the complaint on AWS support centre. This is what they sent to me that worked effortlessly. The agent installation failed because the CodeDeploy agent does not support Ruby 2.5 (shipped by Ubuntu 18.04 repositories) [2] yet. WorkaroundYou can still install the CodeDeploy agent on Ubuntu 18.04 by downgrading Ruby to version 2.3 (shipped by Ubuntu 16.04 repositories) [3]. Please follow these steps to downgrade Ruby to version 2.3: remove ruby 2.5/rake if installedsudo apt purge libruby ruby rake add repositories for Ubuntu 16.04sudo cat << EOF > /etc/apt/sources.list.d/xenial.list priorise ruby/rake from Ubuntu 16.04 repositorysudo cat << EOF > /etc/apt/preferences.d/ruby-xenial Package: rake install ruby and dependent packagessudo apt update You can proceed to the CodeDeploy agent installation following the same documentation [1] after downgrading Ruby. I hope this helps someone. |
Ensure you specify the path in the right ruby installation once you download the package from the right sim bucket.. mine was - sudo /usr/share/rvm/rubies/ruby-2.3.5/bin/ruby ./install auto |
It's kind of funny that support proposes something we added as recommendation in this issue some time ago. However, that may break software that relies on newer Ruby releases - use it with caution. |
Thanks @commx Codedeploy is the only ruby dependent solution we intend to run on this server but your advice is well noted. |
encountered the same issue, it is sad to see that new shiny product from AWS does not support new Ubuntu LTS |
@gregkonushev-okta hey we have already rolled out a fix for this , its already in us-east-1 and being rolled out in other regions too. |
@rohkat-aws that's great, which version of codedeploy agent works with ruby 2.5? When will you have rollout on us-east-2? |
If you want to beta test the version from us-east-1 on ubuntu 18.04:
|
Looks like fixed versions are now available on most common regions:
|
resolved for a while,after the last agent release |
I'm trying to install the aws-codedeploy-agent on Ubuntu 18.04.
Ubuntu 18.04 comes with ruby 2.5.1
I followed the advice and create a symlink from ruby2.4 => ruby2.5 and re-ran installation:
At this point I rather desperately created a symlink between ruby2.5 and ruby2.3 without actually expecting it to work and as I suspected, no luck, same error.
Any suggestions other than trying to install ruby2.4 via rvm which I have also tried and failed (don't have the logs from that attempt)?
The text was updated successfully, but these errors were encountered: