Skip to content
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

Package Uffizzi CLI for Debian #329

Open
gadkins opened this issue Sep 8, 2023 · 4 comments
Open

Package Uffizzi CLI for Debian #329

gadkins opened this issue Sep 8, 2023 · 4 comments
Assignees

Comments

@gadkins
Copy link
Member

gadkins commented Sep 8, 2023

Package the Uffizzi CLI for Debian flavors of Linux with apt-get (and maybe dpkg if it makes sense).

@gadkins gadkins added the priority 1 Urgent issue label Sep 12, 2023
@axisofentropy
Copy link
Member

It looks like gem2deb is the primary tool to use.

We'll probably want to enumerate all of the gems we depend upon and then decide for each of them whether to use an existing Debian package or install and include them within our package?

Research sources:

Probably the best source: https://wiki.debian.org/Teams/Ruby/Packaging

Recent article on packaging a Ruby gem: https://www.godobject.net/articles/15

@axisofentropy
Copy link
Member

My workstation is currently using Ubuntu 22.04.3 LTS. Here's what's available for the gems we're using within uffizzi.gemspec:

runtime:

  • 'activesupport' - ruby-activesupport
  • 'awesome_print' - ruby-awesome-print
  • 'faker' - ruby-faker
  • 'launchy' - ruby-launchy
  • 'minitar' - ruby-minitar
  • 'securerandom' - may be provided in another package? stdlib?
  • 'sentry-ruby' - ruby-sentry-raven ???
  • 'thor' - ruby-thor
  • 'tty-prompt' - ruby-tty-prompt
  • 'tty-spinner' - ruby-tty-spinner

build:

  • 'bump' - no packages found
  • 'bundler' - ruby-bundler
  • 'byebug' - ruby-byebug
  • 'deepsort' - no packages found
  • 'factory_bot' - ruby-factory-bot
  • 'fakefs' - ruby-fakefs
  • 'minitest' - ruby-minitest
  • 'minitest-power_assert' - ruby-minitest-power-assert
  • 'mocha' - ruby-mocha
  • 'open3' - can we use ruby-open4 ???
  • 'pry-byebug' - ruby-pry-byebug
  • 'pry-inline' - maybe within another package ???
  • 'rake' - rake ???
  • 'ronn-ng' - ruby-ronn ???
  • 'rubocop' - rubocop ???
  • 'rubocop-minitest' - not found
  • 'rubocop-rake' - not found
  • 'webmock' - ruby-webmock

@axisofentropy
Copy link
Member

axisofentropy commented Sep 13, 2023

gem2deb does a lot for us. Following this guide: https://wiki.debian.org/Teams/Ruby/Packaging/gem2deb

Here's my first manual pass on Ubuntu 22.04 LTS:

Set some environment variables:

export [email protected]
export DEBFULLNAME="Adam Vollrath"

Move to an empty directory:

mkdir -p ~/Build/ruby-packaging && cd $_

Install dependency Debian packages. I needed to install this list, your list may be different and gem2deb should tell you.

sudo apt-get install ruby-activesupport ruby-awesome-print ruby-faker ruby-launchy ruby-minitar ruby-thor ruby-tty-prompt ruby-tty-spinner

Install some additional dependencies that are not in Debian packages:

sudo gem install sentry-ruby
sudo gem install --version '~> 0.7.0' pastel

I needed to run gem2deb with the -d option to skip dependency checking because it wanted a ruby-sentry-ruby package which does not exist as far as I can tell.

gem2deb -d uffizzi-cli

This created a .deb package! It seems mostly valid, though it may have problems finding some of those packages it depends upon:

$ dpkg --info ruby-uffizzi-cli_2.0.36-1_all.deb
 new Debian package, version 2.0.
 size 29292 bytes: control archive=1858 bytes.
     462 bytes,    12 lines      control              
    6011 bytes,    50 lines      md5sums              
 Package: ruby-uffizzi-cli
 Version: 2.0.36-1
 Architecture: all
 Maintainer: Debian Ruby Team <[email protected]>
 Installed-Size: 188
 Depends: ruby, ruby-activesupport, ruby-awesome-print, ruby-faker, ruby-launchy, ruby-minitar, ruby-securerandom, ruby-sentry-ruby, ruby-thor, ruby-tty-prompt, ruby-tty-spinner
 Section: ruby
 Priority: optional
 Homepage: https://uffizzi.com
 Description: uffizzi-cli
  uffizzi-cli
 Ruby-Versions: all

Sure enough it wants a package that I don't think exists:

$ sudo dpkg -i ruby-uffizzi-cli_2.0.36-1_all.deb
Selecting previously unselected package ruby-uffizzi-cli.
(Reading database ... 334260 files and directories currently installed.)
Preparing to unpack ruby-uffizzi-cli_2.0.36-1_all.deb ...
Unpacking ruby-uffizzi-cli (2.0.36-1) ...
dpkg: dependency problems prevent configuration of ruby-uffizzi-cli:
 ruby-uffizzi-cli depends on ruby-sentry-ruby; however:
  Package ruby-sentry-ruby is not installed.

dpkg: error processing package ruby-uffizzi-cli (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 ruby-uffizzi-cli

@axisofentropy
Copy link
Member

axisofentropy commented Sep 13, 2023

FWIW I was able to download and install this package and then I could install the .deb created above. http://ftp.us.debian.org/debian/pool/main/r/ruby-sentry-ruby/ruby-sentry-ruby_5.9.0-3_all.deb

But looks like we'll have some more work to do in packaging:

$ /usr/bin/uffizzi 
CLI Error:
No such file or directory @ rb_sysopen - /usr/share/rubygems-integration/all/gems/uffizzi-cli-2.0.36/man/uffizzi.ronn

That said, the binary does "work":

adam@ephemeron:~/Build/ruby-packaging$ /usr/bin/uffizzi login
Opening in existing browser session.
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
Login successfull
Select an account: axisofentropy
Select a project or create a new project: quickstart
adam@ephemeron:~/Build/ruby-packaging$ /usr/bin/uffizzi cluster list
- antonetta-cormier

@gadkins gadkins removed the priority 1 Urgent issue label Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

2 participants