Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAOS-17287 build: Remove separate rpm build for raft #16094

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

jolivier23
Copy link
Contributor

Just include the submodule in the daos sources

Steps for the author:

  • Commit message follows the guidelines.
  • Appropriate Features or Test-tag pragmas were used.
  • Appropriate Functional Test Stages were run.
  • At least two positive code reviews including at least one code owner from each category referenced in the PR.
  • Testing is complete. If necessary, forced-landing label added and a reason added in a comment.

After all prior steps are complete:

  • Gatekeeper requested (daos-gatekeeper added as a reviewer).

Copy link

github-actions bot commented Mar 13, 2025

Ticket title is 'Remove separate daos-raft rpm build'
Status is 'In Review'
https://daosio.atlassian.net/browse/DAOS-17287

@daosbuild1
Copy link
Collaborator

Test stage Build RPM on EL 9 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-16094/1/execution/node/342/log

@jolivier23 jolivier23 requested review from liw and johannlombardi and removed request for liw and johannlombardi March 13, 2025 20:23
@daosbuild1
Copy link
Collaborator

Test stage Build RPM on EL 8 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-16094/1/execution/node/311/log

@daosbuild1
Copy link
Collaborator

Test stage Build DEB on Ubuntu 20.04 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-16094/1/execution/node/261/log

@daosbuild1
Copy link
Collaborator

Test stage Build RPM on Leap 15.5 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-16094/1/execution/node/318/log

@jolivier23 jolivier23 force-pushed the jvolivie/remove_raft_rpm branch from 8697264 to 8a6807b Compare March 13, 2025 21:19
Just include the submodule in the daos sources

Signed-off-by: Jeff Olivier <jeffolivier@google.com>
@jolivier23 jolivier23 force-pushed the jvolivie/remove_raft_rpm branch from 8a6807b to d28541b Compare March 13, 2025 21:33
@jolivier23 jolivier23 marked this pull request as ready for review March 13, 2025 22:03
@jolivier23 jolivier23 requested a review from a team as a code owner March 13, 2025 22:03
Signed-off-by: Jeff Olivier <jeffolivier@google.com>
Signed-off-by: Jeff Olivier <jeffolivier@google.com>
liw
liw previously approved these changes Mar 17, 2025
Copy link
Contributor

@liw liw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for your reference, here's my old script that I tested carefully in the past. It used a different approach---more git archive than tar. Might be useful if you would like to verify the contents of the output tarball by comparing to one produced by a different approach.

#!/bin/bash
#
# Usage: archive.sh <dir> <name> <version> <extension>
#
# Create an archive of the HEAD commit of a local Git repository, including
# submodules.
#
#   - Must run at the root of the Git repository.
#   - Must have all submodules initialized and updated.
#   - Whitespaces are prohibited in any of the parameters.
#   - Submodules within submodules are not supported.
#
# For example,
#
#   archive.sh /a/b/c daos 1.2.3 tar
#
# produces /a/b/c/daos-1.2.3.tar.
#

set -e

dir=$1
name=$2
version=$3
ext=$4

# Use a temporary directory for all intermediate files.
unset tmp
trap 'if [ -n "$tmp" ]; then rm -rf "$tmp"; fi' EXIT
tmp=$(mktemp -d)

file_extless=$name-$version
file=$file_extless.$ext
sm_file_prefix=$file_extless-submodule

# Create an archive, which doesn't include any submodule.
git archive --prefix $name-$version/ -o $tmp/$file HEAD

# Add all submodules to the archive.
git submodule --quiet foreach \
	"git archive --prefix $name-$version/\$sm_path/ -o $tmp/$sm_file_prefix-\$name.$ext \$sha1"
tar -Af $tmp/$file $tmp/$sm_file_prefix-*.$ext

# Publish the archive.
mv $tmp/$file $dir/$file

Signed-off-by: Jeff Olivier <jeffolivier@google.com>
@jolivier23
Copy link
Contributor Author

#!/bin/bash

Usage: archive.sh

Create an archive of the HEAD commit of a local Git repository, including

submodules.

- Must run at the root of the Git repository.

- Must have all submodules initialized and updated.

- Whitespaces are prohibited in any of the parameters.

- Submodules within submodules are not supported.

For example,

archive.sh /a/b/c daos 1.2.3 tar

produces /a/b/c/daos-1.2.3.tar.

set -e

dir=$1
name=$2
version=$3
ext=$4

Use a temporary directory for all intermediate files.

unset tmp
trap 'if [ -n "$tmp" ]; then rm -rf "$tmp"; fi' EXIT
tmp=$(mktemp -d)

file_extless=$name-$version
file=$file_extless.$ext
sm_file_prefix=$file_extless-submodule

Create an archive, which doesn't include any submodule.

git archive --prefix $name-$version/ -o $tmp/$file HEAD

Add all submodules to the archive.

git submodule --quiet foreach
"git archive --prefix $name-$version/$sm_path/ -o $tmp/$sm_file_prefix-$name.$ext $sha1"
tar -Af $tmp/$file $tmp/$sm_file_prefix-*.$ext

Publish the archive.

mv $tmp/$file $dir/$file

thanks, Li Wei. I have a subsequent PR that is trying to do the same for spdk and will require recursion

jolivier23 and others added 4 commits March 18, 2025 18:54
Signed-off-by: Jeff Olivier <jeffolivier@google.com>
Co-authored-by: Li Wei <liwei@hpe.com>
Signed-off-by: Jeff Olivier <jeffolivier@google.com>
Signed-off-by: Jeff Olivier <jeffolivier@google.com>
Signed-off-by: Jeff Olivier <jeffolivier@google.com>
@jolivier23 jolivier23 requested a review from liw March 19, 2025 02:18
Signed-off-by: Jeff Olivier <jeffolivier@google.com>
Signed-off-by: Jeff Olivier <jeffolivier@google.com>
@jolivier23 jolivier23 requested a review from liw March 19, 2025 03:26
# shellcheck disable=SC2086,SC2016
git submodule --quiet foreach --recursive \
'tarfile='${tmp}/${sm_file_prefix}'-$name.'${ext}' && \
git archive --prefix '${name}-${version}'/$displaypath/ -o ${tarfile} $sha1 && \
Copy link
Contributor

@liw liw Mar 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think sm_path is more correct than displaypath, though if we are at the root of daos they are the same. For example, if we are in src, then

    sm_path=src/rdb/raft
displaypath=rdb/raft

while we always want the prefix to be name-version/src/rdb/raft.

Copy link
Contributor Author

@jolivier23 jolivier23 Mar 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liw sm_path didn't work for recursive submodules (follow-on spdk patch) and the comment at the top says it has to be run from root.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Then let's go with displaypath.

@daosbuild1
Copy link
Collaborator

Test stage Functional Hardware Large completed with status FAILURE. https://build.hpdd.intel.com/job/daos-stack/job/daos/job/PR-16094/10/display/redirect

@daosbuild1
Copy link
Collaborator

Test stage Functional Hardware Medium completed with status FAILURE. https://build.hpdd.intel.com/job/daos-stack/job/daos/job/PR-16094/10/display/redirect

@daosbuild1
Copy link
Collaborator

Test stage Functional Hardware Medium Verbs Provider completed with status FAILURE. https://build.hpdd.intel.com/job/daos-stack/job/daos/job/PR-16094/10/display/redirect

@daosbuild1
Copy link
Collaborator

Test stage Functional Hardware Medium completed with status FAILURE. https://build.hpdd.intel.com/job/daos-stack/job/daos/job/PR-16094/11/display/redirect

@daosbuild1
Copy link
Collaborator

Test stage Functional Hardware Large completed with status FAILURE. https://build.hpdd.intel.com/job/daos-stack/job/daos/job/PR-16094/11/display/redirect

@daosbuild1
Copy link
Collaborator

Test stage Functional Hardware Medium Verbs Provider completed with status FAILURE. https://build.hpdd.intel.com/job/daos-stack/job/daos/job/PR-16094/11/display/redirect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants