Skip to content

Instantly share code, notes, and snippets.

@tcooper
Last active April 9, 2017 20:41
Show Gist options
  • Save tcooper/11065345 to your computer and use it in GitHub Desktop.
Save tcooper/11065345 to your computer and use it in GitHub Desktop.
Lustre Client RPM Patch/Build Process

Patching Lustre Client RPM's

This example will apply a patch for LU-4558 to Lustre v2_4_3 and rebuild the client RPM's.

The Gerrit site for Lustre is at...

http://review.whamcloud.com/

Clone Lustre repository

In this example we use the review.whamclould.com/fs/lustre-release.git repository...

desktop:~ mockbuild$ ssh buildhost
Last login: Sun Apr 13 09:23:03 2014 from desktop.example.com
Rocks 6.1 (Emerald Boa)
Profile built 11:08 21-Aug-2013

Kickstarted 11:39 21-Aug-2013

Rocks 6.1 Development Server

[mockbuild@buildhost ~]# cd /export/build/

[mockbuild@buildhost build]# mkdir review.whamcloud.com

[mockbuild@buildhost build]# cd review.whamcloud.com/

[mockbuild@buildhost review.whamcloud.com]# git clone \
  http://review.whamcloud.com/fs/lustre-release
Cloning into 'lustre-release'...
remote: Counting objects: 267481, done
remote: Finding sources: 100% (267481/267481)
remote: Total 267481 (delta 171477), reused 248955 (delta 171477)
Receiving objects: 100% (267481/267481), 223.05 MiB | 1.48 MiB/s, done.
Resolving deltas: 100% (171477/171477), done.

[mockbuild@buildhost review.whamcloud.com]# cd lustre-release/

Checkout tagged version

[mockbuild@buildhost lustre-release]# git checkout v2_4_3
Note: checking out 'v2_4_3'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 03c20f7... New tag 2.4.3-RC1

Cherry-pick the commit for a Lustre Bug

The Gerrit site is used to get the cherry-pick command for this bug.

  http://review.whamcloud.com/#/c/9876/

Examine the 'Strategy' for application on the left hand side of the page. For this example the 'Strategy' is 'Cherry Pick'

Click on 'Download' on the right hand side of the page, then click on the copy/paste icon at the end of the row for 'Cherry-Pick'. That will put the necessary git commands into your copy/paste buffer. Use those commands below...

[mockbuild@buildhost lustre-release]# git fetch \
  http://review.whamcloud.com/fs/lustre-release \
  refs/changes/76/9876/4 && git cherry-pick FETCH_HEAD
remote: Counting objects: 9, done
remote: Finding sources: 100% (5/5)
remote: Total 5 (delta 1), reused 2 (delta 1)
Unpacking objects: 100% (5/5), done.
From http://review.whamcloud.com/fs/lustre-release
 * branch            refs/changes/76/9876/4 -> FETCH_HEAD
[detached HEAD 8eb00a4] LU-4558 clio: Solve a race in cl_lock_put
 Author: Jinshan Xiong <jinshan.xiong@intel.com>
 1 file changed, 9 insertions(+), 1 deletion(-)

Build

[mockbuild@buildhost lustre-release]$ (sh ./autogen.sh && \
  ./configure --disable-server --disable-tests && make rpms) 2>&1 | \
  tee build_v2_4_3_LU-4558.log

Repeating...

If/when repeating a bug build you should either reclone the entire repository OR do the following...

Reset to HEAD

[mockbuild@buildhost lustre-release]$ git checkout master
Warning: you are leaving 1 commits behind, not connected to
any of your branches:

  419d7e3 LU-4558 clio: Solve a race in cl_lock_put

If you want to keep them by creating a new branch, this may be a good time
to do so with:

 git branch new_branch_name 1085be26f1760f249a03634ff4e84dd0618d7bcc

Switched to branch 'master'

[mockbuild@buildhost lustre-release]$ rm -rf ./*

[mockbuild@buildhost lustre-release]$ git reset --hard HEAD
HEAD is now at ac5cd8f LU-4917 lfsck: dump layout lfsck correctly

Update the repo

[mockbuild@buildhost lustre-release]$ git pull
Already up-to-date.

Checkout New Tag

[mockbuild@buildhost lustre-release]$ git checkout v2_4_3
Note: checking out 'v2_4_3'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 03c20f7... New tag 2.4.3-RC1

Cherry-Pick Bug(s)

NOTE: You can repeat the cherry-pick for all bugs you want to include in this rebuild.

[mockbuild@buildhost lustre-release]$ git fetch \
  http://review.whamcloud.com/fs/lustre-release \
  refs/changes/76/9876/4 && git cherry-pick FETCH_HEAD
From http://review.whamcloud.com/fs/lustre-release
 * branch            refs/changes/76/9876/4 -> FETCH_HEAD
[detached HEAD 64f0bb6] LU-4558 clio: Solve a race in cl_lock_put
 Author: Jinshan Xiong <jinshan.xiong@intel.com>
 1 file changed, 9 insertions(+), 1 deletion(-)

[mockbuild@buildhost lustre-release]$ git fetch http://review.whamcloud.com/fs/lustre-release refs/changes/79/9879/1 && git cherry-pick FETCH_HEAD
remote: Counting objects: 11, done
remote: Finding sources: 100% (6/6)
remote: Total 6 (delta 1), reused 2 (delta 1)
Unpacking objects: 100% (6/6), done.
From http://review.whamcloud.com/fs/lustre-release
 * branch            refs/changes/79/9879/1 -> FETCH_HEAD
[detached HEAD 1085be2] LU-2982 build: make AC check for linux arch sandbox friendly
 Author: Dmitry Eremin <dmitry.eremin@intel.com>
 2 files changed, 1 insertion(+), 25 deletions(-)

Rebuild rpms

[mockbuild@buildhost lustre-release]$ (sh ./autogen.sh && \
  ./configure --disable-server --disable-tests && make rpms) 2>&1 | \
  tee build_v2_4_3_LU-4558_LU-2982.log

[mockbuild@gordon-fe3 ~]$ tree ~/rpmbuild/RPMS/
/home/mockbuild/rpmbuild/RPMS/
├── noarch
│   └── lustre-iokit-1.4.0-1.noarch.rpm
└── x86_64
	├── lustre-client-2.4.3-2.6.32_358.6.2.el6.x86_64_gfd0d027.x86_64.rpm
	├── lustre-client-modules-2.4.3-2.6.32_358.6.2.el6.x86_64_gfd0d027.x86_64.rpm
	└── lustre-client-source-2.4.3-2.6.32_358.6.2.el6.x86_64_gfd0d027.x86_64.rpm

2 directories, 4 files

Clean up

When finished you should clean out the repository and rpmbuild directories...

[mockbuild@gordon-fe3 ~]$ \rm -rf ~/rpmbuild

[mockbuild@buildhost lustre-release]$ git checkout master
Warning: you are leaving 2 commits behind, not connected to
any of your branches:

  1085be2 LU-2982 build: make AC check for linux arch sandbox friendly
  419d7e3 LU-4558 clio: Solve a race in cl_lock_put

If you want to keep them by creating a new branch, this may be a good time
to do so with:

 git branch new_branch_name 1085be26f1760f229a03634ff4e84dd0618d7bcc

Switched to branch 'master'
[mockbuild@buildhost lustre-release]$ \rm -rf ./*
[mockbuild@buildhost lustre-release]$ git reset --hard HEAD
HEAD is now at ac5cd8f LU-4917 lfsck: dump layout lfsck correctly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment