Skip to content

Instantly share code, notes, and snippets.

View ianballou's full-sized avatar

Ian Ballou ianballou

View GitHub Profile
@ianballou
ianballou / gist:47cf61b7eec202220f90457d052e6e50
Created February 7, 2023 18:49
Start Foreman rails without Foreman
source ~/foreman/.env
BIND=0.0.0.0 bundle exec puma -w 1 -t 1 -p $PORT --preload
@ianballou
ianballou / gist:334c06aa4acd5c4415f36b1c86ff94d6
Created January 26, 2023 20:04
Katello development tips
Dev env tips
- Start rails in one terminal: bundle exec foreman start rails
- Start webpack in another terminal: bundle exec foreman start webpack
- Debug a file:
1) Edit ~/foreman/.env to ensure puma is running with a single CPU
2) Restart your server
3) Insert `binding.pry` where you need to debug
@ianballou
ianballou / gist:c1be134401de8cd2cf526f765bbac84a
Created January 26, 2023 16:54
Libvirt-related services to check after vagrant errors
libvirtd
virtnetworkd
@ianballou
ianballou / http_proxy.rb
Created November 22, 2022 19:14
Ruby HTTP proxy
#!/usr/bin/ruby
require 'webrick'
require 'webrick/httpproxy'
proxy = WEBrick::HTTPProxyServer.new Port: 8777
trap 'INT' do proxy.shutdown end
trap 'TERM' do proxy.shutdown end
proxy.start
@ianballou
ianballou / gist:0094a8585dc39a6aa9c7c427e64f377d
Created April 28, 2022 19:00
Ordering Pulpcore client binding packaging updates
1) Have a PR against katello.git and foreman-packaging.git ready, both are ack'ed. Merge the katello one (it will build new source, but won't build a nightly rpm at that point, as deps are broken)
2) Merge the packaging pr
3) Open a new packaging PR updating the deps of rubygem-katello to match what was commited to katello.git (we have scripts for that)
-> Once the new katello source is built on jenkins, and the pulp bindings rpms are also built this third pr will become buildable/green, you merge that, everyone happy
To update rubygem-katello automatically:
gem2rpm -t gem2rpm/foreman_plugin.spec.erb katello-4.5.0.pre.master.gem | ./update-requirements specfile - packages/katello/rubygem-katello/rubygem-katello.spec
gem2rpm is in fedora, the spec.erb is in packaging.git and so is update-requirements
@ianballou
ianballou / gist:304c1b5f54209b38d225235c0379257e
Created April 26, 2022 16:33
Katello tests that also have Pulp 3 VCRs
mode=all ktest test/models/content_view_package_group_filter_test.rb -ntest_content_unit_pulp_ids_returns_pulp_href
mode=all ktest test/lib/tasks/pulpcore/repository_vcr_test.rb -ntest_correct_repositories_fixes_deleted_library_repo
# Precursor: a user tries deleting a repository, but the task fails because there are related CVV repositories
# Load the repository that needs to be deleted:
# repository = ::Katello::Repository.find(< library repo id >)
library_instances_inverse = repository.library_instances_inverse
# Double check that the `library_instances_inverse` repositories are all CV repos that should be deleted
affected_cvv_ids = library_instances_inverse.pluck(:content_view_version_id).uniq
# Double check that the content view versions are indeed the ones that should lose the target repository
ForemanTasks.sync_task(::Actions::BulkAction, ::Actions::Katello::Repository::Destroy, library_instances_inverse)
@ianballou
ianballou / 99-local.yaml
Created May 21, 2021 14:35
forklift 99-local.yaml
---
centos8:
box: centos8
cpus: 4
memory: 10000
centos7-katello-devel:
primary: true
box: centos7
cpus: 4
@ianballou
ianballou / gist:342b53e1c3de6dec07a8c430b984f4a1
Created April 29, 2021 17:47
Install or update Pulp 3 from PyPI on a Katello system
sudo pip3 install scikit-build nose
sudo yum install -y gcc make cmake bzip2-devel expat-devel file-devel glib2-devel libcurl-devel libmodulemd2-devel ninja-build libxml2-devel python36-devel python36-gobject rpm-devel openssl-devel sqlite-devel xz-devel zchunk-devel zlib-devel swig3
sudo pip3 install "git+https://github.com/pulp/pulpcore.git" \
"git+https://github.com/pulp/pulp_file.git" \
"git+https://github.com/pulp/pulp_rpm.git" \
"git+https://github.com/pulp/pulp_container.git" \
"git+https://github.com/pulp/pulp-2to3-migration.git"
cd /tmp
/**
* @ngdoc object
* @name Bastion.docker-tags.controller:DockerTagDetailsController
*
* @requires $scope
* @requires $location
* @requires DockerTag
* @requires CurrentOrganization
*
* @description