Project

General

Profile

Pulp 3 Integration » History » Version 40

Samir Jha, 02/21/2020 12:10 AM

1 1 Justin Sherrill
h1. Pulp 3 Integration
2
3
This page is meant to capture links to various resources around pulp3 integration
4
5
* Initial Integration Document: https://docs.google.com/document/d/1eFM4H9BteA_nTDbUkRJgEiqSttXfAtB9-51a_OuwVJw/edit?usp=sharing
6
* Initial Community Post: https://community.theforeman.org/t/pulp-3-migration/10474
7
* Youtube Videos: https://www.youtube.com/playlist?list=PL59WSIBtIpv7tbjnsEAWNcdiOKAmjjgqE
8
* Tasks List: https://docs.google.com/spreadsheets/d/1PFx-VAEXlivlqDYR9INMW26AUWtuMS_XtEnwhFVP5Rc/edit?usp=sharing
9 17 John Mitsch
* Main Tracker: https://projects.theforeman.org/issues/26987
10 2 Justin Sherrill
11 40 Samir Jha
h2. Katello Dev box with yum plugin using vagrant:
12
13
+*Install and enable pulp_rpm plugin*+ 
14
15
* vagrant up katello-dev-box
16
* vagrant ssh katello-dev-box
17
* Execute commands below: 
18
<pre>
19
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
20
sudo pip3 install scikit-build nose
21
sudo pip3 install pulp-rpm==3.0.0
22
sudo -u pulp PULP_SETTINGS='/etc/pulp/settings.py' DJANGO_SETTINGS_MODULE='pulpcore.app.settings' python3-django-admin migrate --no-input
23
sudo systemctl restart pulpcore-resource-manager pulpcore-content pulpcore-api pulpcore-worker@1 pulpcore-worker@2
24
</pre>
25
26
* Refresh the smart proxy 
27
# login to katello/foreman
28
# navigate to infrastructure > smart proxies
29
# click 'refresh' in the list of actions beside your smart proxy
30
31
You should now see file, docker and yum as supported content type under pulpcore in the *Services tab*  
32
33
34
35
36
h2. Katello Dev environment with pulp 3 using ansible playbook:
37 2 Justin Sherrill
38 15 Justin Sherrill
* Install a katello dev environment with forklift
39 32 Ian Ballou
* Install the following packages in your dev box: 
40 34 Ian Ballou
<pre>sudo yum -y install https://people.redhat.com/iballou/libcomps-0.1.12-1.git.0.937a666.el7.x86_64.rpm</pre>
41
<pre>sudo yum -y install https://people.redhat.com/iballou/python3-libcomps-0.1.12-1.git.0.937a666.el7.x86_64.rpm</pre>
42 15 Justin Sherrill
* checkout this forklift pr if its not merged: https://github.com/theforeman/forklift/pull/980
43
* setup ansible-pulp:
44
<pre>
45
cd forklift
46
git clone https://github.com/pulp/ansible-pulp.git
47 1 Justin Sherrill
cd ansible-pulp
48 15 Justin Sherrill
ansible-galaxy install -r requirements.yml -p ./roles
49 29 Justin Sherrill
ansible-galaxy install pulp.pulp_rpm_prerequisites -p ./roles
50 15 Justin Sherrill
</pre>
51 24 Samir Jha
52
53 15 Justin Sherrill
* within forkflift run:
54
<pre>
55
ansible-playbook ./playbooks/katello_pulp3.yml -l centos7-katello-devel
56
</pre>
57 1 Justin Sherrill
58 15 Justin Sherrill
* Refresh the smart proxy: 
59
60
  1. login to katello/foreman
61
  2. navigate to infrastructure > smart proxies
62
  3. click 'refresh' in the list of actions beside your smart proxy
63
You're now rockin' Pulp3
64 18 Partha Aji
65
66 22 Samir Jha
* *Known Issue:* Can't seem to use pulp3 on the box since pulp-api.service fails to start.
67
<pre>
68
sudo chmod -R 777 /etc/pki/pulp/
69 30 John Mitsch
sudo systemctl restart pulpcore-api.service
70 22 Samir Jha
</pre>
71 18 Partha Aji
72 33 Chris Roberts
* Reset the Katello Pulp 3 Dev Environment
73
From within the Foreman directory:
74
<pre>bundle exec rake katello:reset</pre>
75
76 23 Samir Jha
h2. Smart Proxy Setup:
77
78
* Install a smart proxy to point to your pulp3_dev box
79
* ssh into the smart proxy
80
* sudo mkdir /etc/httpd/conf.d/05-foreman-ssl.d
81
* sudo vi /etc/httpd/conf/httpd.conf
82
* Add IncludeOptional "/etc/httpd/conf.d/05-foreman-ssl.d/*.conf to the end of the file and save
83
* In forklift > Run ansible-playbook ./playbooks/katello_pulp3.yml -l centos7-proxy-devel
84
85 15 Justin Sherrill
h3. Other Resources
86
87
* pulp3 gap analysis wiki https://projects.theforeman.org/projects/katello/wiki/PulpV3GapAnalysis
88
* pulp3 gap analysis etherpad https://etherpad.net/p/pulp3_container
89
* pulp3 docker roadmap https://pulp.plan.io/projects/pulp/wiki/Pulp_Docker_Roadmap
90
91
92 16 Ian Ballou
h3. Old way to deploy pulp3 on other box
93 2 Justin Sherrill
* <pre>yum install vagrant-sshfs</pre>
94
* Checkout pulplift: https://github.com/pulp/pulplift 
95 6 Justin Sherrill
* Follow pulplift readme instructions, copy the centos7-pulp3-github box definition from vagrant/boxes.d/99-local.yaml.example 
96 2 Justin Sherrill
* vagrant up centos7-pulp3-github
97
* On katello dev env, edit /etc/foreman-proxy/settings.d/pulp3.yml    
98
** add/edit options (replacing dev.pulp3 with ip address or hostname of pulplift box):
99
<pre>
100 12 John Mitsch
:enabled: true
101
:pulp_url: http://dev.pulp3/pulp/
102
</pre> 
103
* restart foreman-proxy:  systemctl restart foreman-proxy
104 13 John Mitsch
* refresh your smart proxy, from the Infrastructure > Smart Proxies page
105 14 John Mitsch
* Confirm that you see 'pulp3' show up in the list of features for that smart proxy
106 25 Justin Sherrill
107 35 Samir Jha
h3. Deploying pulp3 on new dev boxes with postgres12:
108
109 38 Samir Jha
In forklift, on branch with https://github.com/theforeman/forklift/pull/980 apply patch https://gist.github.com/sjha4/5d4189eae804bd2b3229c10870f56ac2#file-forklift-patch
110
111 1 Justin Sherrill
cd ansible-pulp
112 38 Samir Jha
Apply patch https://gist.github.com/sjha4/5d4189eae804bd2b3229c10870f56ac2#file-0001-psql12-patch 
113
114 35 Samir Jha
vagrant ssh into devel box
115
run 
116
sudo ln -s /opt/rh/rh-postgresql12/root/usr/bin/pg_config /usr/sbin/pg_config
117
sudo ln -s /opt/rh/rh-postgresql12/root/usr/lib64/libpq.so.rh-postgresql12-5 /usr/lib64/libpq.so.rh-postgresql12-5
118
exit
119
Run the playbook.
120
It might fail with postmaster.pid exists. In which case, ssh into dev box. 
121
sudo systemctl stop *postgresql*
122 36 Samir Jha
find / -name postmaster.pid
123
rm -f ^^
124 35 Samir Jha
re-run the playbook.
125
126
Candlepin will probably stop working at this point. To fix this:
127
sudo vi /var/opt/rh/rh-postgresql12/lib/pgsql/data/pg_hba.conf
128
in the file set all the auth from peer to trust.
129
sudo systemctl restart *postgres*
130
131 25 Justin Sherrill
h3. Updating of pulp client binding Gems
132
133
Every two weeks on a Friday, a PR should be open against katello to bump the client gems.  A script is provided https://gist.githubusercontent.com/jlsherrill/836268d9ee9b33fc1fff06e9061db4f4/raw/7a1044725b00c44246fd241e9bed644c5fab6321/generate_pulp3_deps.rb to output the relevant requirements that can be put into katello.gemspec.
134
135
Example PR: https://github.com/Katello/katello/pull/8294
136
137
If there are test failures, investigate and attempt to fix them.  VCR re-recording may be necessary. 
138
139
If there is some expected change, this process can be done more often.
140
141
We will ask for a volunteer the thursday prior to each friday.  Current Schedule:
142
143
Sept 6th
144
Sept 20th
145
Oct  4th
146
Oct 18th