(Created page with "Building 500+ packages for ppc64le can take quite a while. So I took steps to speed up the mock process located at [https://marcin.juszkiewicz.com.pl/2016/04/15/how-to-speed-...") |
No edit summary |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Building 500+ packages for ppc64le can take quite a while. So I took steps to speed up the mock process located at [https://marcin.juszkiewicz.com.pl/2016/04/15/how-to-speed-up-mock/]. | Building 500+ packages for ppc64le can take quite a while. So I took steps to speed up the mock process located at [https://marcin.juszkiewicz.com.pl/2016/04/15/how-to-speed-up-mock/] and [http://miroslav.suchy.cz/blog/archives/2015/05/28/increase_mock_performance_-_build_packages_in_memory/index.html]. | ||
The first step was to create a new mock configuration: | The first step was to create a new mock configuration: | ||
Line 6: | Line 6: | ||
[hamzy@pkvmci853 ~]$ sudo cp /etc/mock/epel-7-ppc64le.cfg /etc/mock/fast-epel-7-ppc64le.cfg | [hamzy@pkvmci853 ~]$ sudo cp /etc/mock/epel-7-ppc64le.cfg /etc/mock/fast-epel-7-ppc64le.cfg | ||
[hamzy@pkvmci853 ~]$ sudo vi /etc/mock/fast-epel-7-ppc64le.cfg | [hamzy@pkvmci853 ~]$ sudo vi /etc/mock/fast-epel-7-ppc64le.cfg | ||
[ | [hamzy@pkvmci853 ~]$ diff -Nu /etc/mock/epel-7-ppc64le.cfg /etc/mock/fast-epel-7-ppc64le.cfg [13/1821] | ||
--- /etc/mock/epel-7-ppc64le.cfg 2017-02-27 11:26:04.000000000 -0500 | --- /etc/mock/epel-7-ppc64le.cfg 2017-02-27 11:26:04.000000000 -0500 | ||
+++ /etc/mock/fast-epel-7-ppc64le.cfg 2017- | +++ /etc/mock/fast-epel-7-ppc64le.cfg 2017-07-02 11:14:04.781704329 -0400 | ||
@@ -1,9 +1, | @@ -1,9 +1,21 @@ | ||
-config_opts['root'] = 'epel-7-ppc64le' | -config_opts['root'] = 'epel-7-ppc64le' | ||
+config_opts['root'] = 'fast-epel-7-ppc64le' | +config_opts['root'] = 'fast-epel-7-ppc64le' | ||
Line 21: | Line 21: | ||
+config_opts['plugin_conf']['root_cache_opts']['compress_program'] = "" | +config_opts['plugin_conf']['root_cache_opts']['compress_program'] = "" | ||
+config_opts['plugin_conf']['root_cache_opts']['extension'] = "" | +config_opts['plugin_conf']['root_cache_opts']['extension'] = "" | ||
+config_opts['plugin_conf']['tmpfs_enable'] = True | |||
+config_opts['plugin_conf']['tmpfs_opts'] = {} | |||
+config_opts['plugin_conf']['tmpfs_opts']['required_ram_mb'] = 1024 | |||
+config_opts['plugin_conf']['tmpfs_opts']['max_fs_size'] = '40g' | |||
+config_opts['plugin_conf']['tmpfs_opts']['mode'] = '0755' | |||
+config_opts['plugin_conf']['tmpfs_opts']['keep_mounted'] = False | |||
+config_opts['macros']['%__gzip'] = '/usr/bin/pigz' | +config_opts['macros']['%__gzip'] = '/usr/bin/pigz' | ||
+config_opts['macros']['%__bzip2'] = '/usr/bin/lbzip2' | +config_opts['macros']['%__bzip2'] = '/usr/bin/lbzip2' | ||
+config_opts['http_proxy'] = 'http://127.0.0.1:3128' | +config_opts['http_proxy'] = 'http://127.0.0.1:3128' | ||
config_opts['yum.conf'] = """ | config_opts['yum.conf'] = """ | ||
[main] | [main] | ||
@@ -38,7 + | @@ -38,7 +50,8 @@ | ||
[epel] | [epel] | ||
name=epel | name=epel | ||
Line 37: | Line 43: | ||
gpgkey=file:///usr/share/distribution-gpg-keys/epel/RPM-GPG-KEY-EPEL-7 | gpgkey=file:///usr/share/distribution-gpg-keys/epel/RPM-GPG-KEY-EPEL-7 | ||
gpgcheck=1 | gpgcheck=1 | ||
@@ -56,7 + | @@ -49,6 +62,7 @@ | ||
failovermethod=priority | |||
gpgkey=file:///usr/share/distribution-gpg-keys/centos/RPM-GPG-KEY-CentOS-7,file:///usr/share/distribution-gpg-keys/centos/RPM-GPG-K | |||
EY-CentOS-SIG-AltArch-7-ppc64le | |||
gpgcheck=1 | |||
+exclude=python-greenlet | |||
[testing] | |||
name=epel-testing | |||
@@ -56,7 +70,6 @@ | |||
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=testing-epel7&arch=ppc64le | mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=testing-epel7&arch=ppc64le | ||
failovermethod=priority | failovermethod=priority | ||
- | - | ||
[local] | [local] | ||
name=local | name=local | ||
baseurl=https://kojipkgs.fedoraproject.org/repos/epel7-build/latest/ppc64le/ | baseurl=https://kojipkgs.fedoraproject.org/repos/epel7-build/latest/ppc64le/ | ||
</pre> | |||
NOTE: however that the following warning is worrying about nosync having an effect. | |||
<pre> | |||
WARNING: nosync is enabled but the library wasn't found on the system | |||
</pre> | </pre> | ||
Line 74: | Line 95: | ||
[root@pkvmci853 ~]# systemctl stop squid | [root@pkvmci853 ~]# systemctl stop squid | ||
[root@pkvmci853 ~]# vi /etc/squid/squid.conf | |||
... | ... | ||
#http_port 3128 | #http_port 3128 | ||
http_port 0.0.0.0:3128 | http_port 0.0.0.0:3128 | ||
... | ... | ||
[root@pkvmci853 ~]# systemctl start squid | [root@pkvmci853 ~]# systemctl start squid | ||
[root@pkvmci853 ~]# netstat -tan | grep 3128 | [root@pkvmci853 ~]# netstat -tan | grep 3128 | ||
Line 100: | Line 121: | ||
tmpfs on /var/lib/mock type tmpfs (rw,relatime,seclabel,size=10240000k,mode=755) | tmpfs on /var/lib/mock type tmpfs (rw,relatime,seclabel,size=10240000k,mode=755) | ||
</pre> | </pre> | ||
Although I think that this step is now not needed with the above plugin_conf/tmpfs_enable. |
Latest revision as of 22:08, 2 July 2017
Building 500+ packages for ppc64le can take quite a while. So I took steps to speed up the mock process located at [1] and [2].
The first step was to create a new mock configuration:
[hamzy@pkvmci853 ~]$ sudo cp /etc/mock/epel-7-ppc64le.cfg /etc/mock/fast-epel-7-ppc64le.cfg [hamzy@pkvmci853 ~]$ sudo vi /etc/mock/fast-epel-7-ppc64le.cfg [hamzy@pkvmci853 ~]$ diff -Nu /etc/mock/epel-7-ppc64le.cfg /etc/mock/fast-epel-7-ppc64le.cfg [13/1821] --- /etc/mock/epel-7-ppc64le.cfg 2017-02-27 11:26:04.000000000 -0500 +++ /etc/mock/fast-epel-7-ppc64le.cfg 2017-07-02 11:14:04.781704329 -0400 @@ -1,9 +1,21 @@ -config_opts['root'] = 'epel-7-ppc64le' +config_opts['root'] = 'fast-epel-7-ppc64le' config_opts['target_arch'] = 'ppc64le' config_opts['legal_host_arches'] = ('ppc64le',) -config_opts['chroot_setup_cmd'] = 'install @buildsys-build' +config_opts['chroot_setup_cmd'] = 'install @buildsys-build nosync /usr/bin/pigz /usr/bin/lbzip2' config_opts['dist'] = 'el7' # only useful for --resultdir variable subst config_opts['releasever'] = '7' +config_opts['nosync'] = True +config_opts['plugin_conf']['root_cache_opts']['compress_program'] = "" +config_opts['plugin_conf']['root_cache_opts']['extension'] = "" +config_opts['plugin_conf']['tmpfs_enable'] = True +config_opts['plugin_conf']['tmpfs_opts'] = {} +config_opts['plugin_conf']['tmpfs_opts']['required_ram_mb'] = 1024 +config_opts['plugin_conf']['tmpfs_opts']['max_fs_size'] = '40g' +config_opts['plugin_conf']['tmpfs_opts']['mode'] = '0755' +config_opts['plugin_conf']['tmpfs_opts']['keep_mounted'] = False +config_opts['macros']['%__gzip'] = '/usr/bin/pigz' +config_opts['macros']['%__bzip2'] = '/usr/bin/lbzip2' +config_opts['http_proxy'] = 'http://127.0.0.1:3128' config_opts['yum.conf'] = """ [main] @@ -38,7 +50,8 @@ [epel] name=epel -mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-7&arch=ppc64le +#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-7&arch=ppc64le +baseurl=https://mirrors.kernel.org/fedora-epel/7/ppc64le/ failovermethod=priority gpgkey=file:///usr/share/distribution-gpg-keys/epel/RPM-GPG-KEY-EPEL-7 gpgcheck=1 @@ -49,6 +62,7 @@ failovermethod=priority gpgkey=file:///usr/share/distribution-gpg-keys/centos/RPM-GPG-KEY-CentOS-7,file:///usr/share/distribution-gpg-keys/centos/RPM-GPG-K EY-CentOS-SIG-AltArch-7-ppc64le gpgcheck=1 +exclude=python-greenlet [testing] name=epel-testing @@ -56,7 +70,6 @@ mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=testing-epel7&arch=ppc64le failovermethod=priority - [local] name=local baseurl=https://kojipkgs.fedoraproject.org/repos/epel7-build/latest/ppc64le/
NOTE: however that the following warning is worrying about nosync having an effect.
WARNING: nosync is enabled but the library wasn't found on the system
The second step is to set up squid:
[root@pkvmci853 ~]# yum install squid [root@pkvmci853 ~]# vi /etc/squid/squid.conf ... cache_dir ufs /home/squid 200000 16 256 maximum_object_size 5 GB ... [root@pkvmci853 ~]# systemctl start squid Job for squid.service failed because the control process exited with error code. See "systemctl status squid.service" and "journalctl -xe" for details. [root@pkvmci853 ~]# ls -ldZ /var/spool/squid/ drwxr-x---. squid squid system_u:object_r:squid_cache_t:s0 /var/spool/squid/ [root@pkvmci853 ~]# semanage fcontext -a -t squid_cache_t /home/squid [root@pkvmci853 ~]# restorecon -v /home/squid restorecon reset /home/squid context unconfined_u:object_r:user_home_dir_t:s0->unconfined_u:object_r:squid_cache_t:s0 [root@pkvmci853 ~]# ls -ldZ /home/squid drwxr-x---. squid squid unconfined_u:object_r:squid_cache_t:s0 /home/squid [root@pkvmci853 ~]# systemctl start squid [root@pkvmci853 ~]# systemctl status squid ... Active: active (running) since Fri 2017-06-30 19:32:31 EDT; 10s ago ... [root@pkvmci853 ~]# netstat -tan | grep 3128 tcp6 0 0 :::3128 :::* LISTEN [root@pkvmci853 ~]# systemctl stop squid [root@pkvmci853 ~]# vi /etc/squid/squid.conf ... #http_port 3128 http_port 0.0.0.0:3128 ... [root@pkvmci853 ~]# systemctl start squid [root@pkvmci853 ~]# netstat -tan | grep 3128 tcp 0 0 0.0.0.0:3128 0.0.0.0:* LISTEN
The next step is to mount mock's directory on tmpfs:
[root@pkvmci853 ~]# ls -lZ /var/lib/mock/ drwxrwsr-x. root mock unconfined_u:object_r:mock_var_lib_t:s0 epel-7-ppc64le-hamzy drwxrwsr-x. root mock unconfined_u:object_r:mock_var_lib_t:s0 fast-epel-7-ppc64le drwxrwsr-x. root mock unconfined_u:object_r:mock_var_lib_t:s0 mockchain2-ppc64le [root@pkvmci853 ~]# mv /var/lib/mock /var/lib/mock.old [root@pkvmci853 ~]# mkdir /var/lib/mock [root@pkvmci853 ~]# mount -t tmpfs -o size=30000M,mode=0755 tmpfs /var/lib/mock/ [root@pkvmci853 ~]# restorecon -v /var/lib/mock/ restorecon reset /var/lib/mock context unconfined_u:object_r:user_tmp_t:s0->unconfined_u:object_r:mock_var_lib_t:s0 [root@pkvmci853 ~]# mount ... tmpfs on /var/lib/mock type tmpfs (rw,relatime,seclabel,size=10240000k,mode=755)
Although I think that this step is now not needed with the above plugin_conf/tmpfs_enable.