Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Commit

Permalink
Add rust rpm provisioner to adm node (#2382)
Browse files Browse the repository at this point in the history
* Add rust rpm provisioner to adm node

Building the rpms locally has been difficult becuase using the docker
container is significantly slower, even after increasing the available
ram and cpu's. In contrast, building in the adm vm appears to be nearly
as fast as building on the host. Furthermore, adding sccache appears to
maintain dependency builds across different branches, allowing for much
quicker builds. This patch adds a new provisioner to build the rust rpms
using the adm virtual machine and takes care of installing all necessary
dependencies, including sccache. To build the rust rpms, simply run the
following:

```
vagrant provision adm --provision-with build-rust-rpms
```

Signed-off-by: johnsonw <wjohnson@whamcloud.com>

* Don't delete the _topdir before invoking the make command

Signed-off-by: johnsonw <wjohnson@whamcloud.com>

* Move env vars into Makefile

Signed-off-by: johnsonw <wjohnson@whamcloud.com>

* Update release version between builds

Signed-off-by: johnsonw <wjohnson@whamcloud.com>

* Move environment variables from Makefile into the .bash_profile of the adm node and resource it before running make.

Signed-off-by: johnsonw <wjohnson@whamcloud.com>

* No need to edit the spec file. The dist can be passed as an environment variable to the Make environment

Signed-off-by: johnsonw <wjohnson@whamcloud.com>
  • Loading branch information
johnsonw authored Dec 3, 2020
1 parent 766ea00 commit 6ff7f17
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions vagrant/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@ Vagrant.configure('2') do |config|
type: 'shell',
run: 'never',
path: 'scripts/load-diagnostics-db.sh'

adm.vm.provision 'build-rust-rpms',
type: 'shell',
run: 'never',
path: 'scripts/build_rust_rpms.sh'
end

#
Expand Down
21 changes: 21 additions & 0 deletions vagrant/scripts/build_rust_rpms.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
yum install -y openssl-devel
yum install -y cargo rpm-build

[ -f /root/.cargo/bin/sccache ] && echo "sccache already installed. Skipping." || cargo install sccache

sed -i '/^export CARGO_HOME/d' /root/.bash_profile
sed -i '/^export SCCACHE_CACHE_SIZE/d' /root/.bash_profile
sed -i '/^export SCCACHE_DIR/d' /root/.bash_profile
sed -i '/^export RUSTC_WRAPPER/d' /root/.bash_profile

cat <<EOF >> /root/.bash_profile
export CARGO_HOME=/root/.cargo
export SCCACHE_CACHE_SIZE=40G
export SCCACHE_DIR=/root/.cache
export RUSTC_WRAPPER=/root/.cargo/bin/sccache
EOF

source /root/.bash_profile

cd /integrated-manager-for-lustre \
&& RPM_DIST=".$(date '+%s')" make copr-rpms

0 comments on commit 6ff7f17

Please sign in to comment.