Skip to content

Commit

Permalink
DAOS-623 build: Resolve issues with Dockerfiles. (#6099)
Browse files Browse the repository at this point in the history
Use pip3 --user and remove temp files.
Do not install pandoc, curl, man or doxygen.
Move leap15 to ci2.
Install missing packages to run NLT in docker.

Signed-off-by: Ashley Pittman <[email protected]>
  • Loading branch information
ashleypittman authored Jul 7, 2021
1 parent 182ab7b commit 537e2b7
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
distro: [centos.7, leap.15]
distro: [centos.7]
compiler: [gcc, clang]
steps:
- name: Checkout code
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
distro: [ubuntu.20.04, centos.8]
distro: [ubuntu.20.04, centos.8, leap.15]
steps:
- uses: actions/checkout@v2
- uses: satackey/[email protected]
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
fail-fast: false
matrix:
# Run this on distros where we don't run the ci1 Workflow.
distro: [ubuntu.20.04, centos.8]
distro: [ubuntu.20.04, centos.8, leap.15]
compiler: [clang, gcc]
steps:
- name: Checkout code
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,5 @@ jobs:
uses: actions/[email protected]
with:
fetch-depth: 100
- name: Install software
run: sudo apt-get install doxygen
- name: Check files
- name: Run check
run: ./ci/copy_doxygen_files.sh
- name: Add problem matcher
run: echo ::add-matcher::ci/daos-doxygen-matcher.json
- name: Run
run: doxygen Doxyfile
- name: Remove matcher
run: echo "::remove-matcher owner=daos-doxygen::"
49 changes: 31 additions & 18 deletions ci/copy_doxygen_files.sh
Original file line number Diff line number Diff line change
@@ -1,31 +1,44 @@
#!/bin/sh
#!/bin/bash

# Prepare the source tree for Doxygen, see .github/workflows/doxygen.yml
# Script to run doxygen against modified headers and report results.
# see .github/workflows/doxygen.yml

set -ex
set -e

echo ::group::Setting up src

# Load the list of modified files.
git fetch
git branch -lr
FILES=$(git diff --name-only origin/master... src/include)
mapfile -t FILES < <(git diff --name-only origin/master... src/include/*.h)

# Ensure there is at least one file present in new dir.
if [ ${#FILES[@]} -eq 0 ];
then
echo No headers modified, exiting.
echo ::endgroup::
exit 0
fi

# Create a new temp directory.
# Make a new directory.
mkdir src/include2

# Copy modified files into it.
for FILE in $FILES
do
cp "$FILE" ./src/include2
done
# Copy the files to new dir.
cp "${FILES[@]}" ./src/include2

# Move real path aside.
# Move the real files aside
mv src/include src/include.old

# And place the modified ones back in place.
# Move in the ones to test.
mv src/include2 src/include

# Ensure there is at least one file present.
if [ -f src/include.old/daos.h ]
then
mv src/include.old/daos.h src/include
fi
echo ::endgroup::

echo ::group::Installing doxygen
sudo apt-get install doxygen
echo ::endgroup::

echo ::group::Running check
echo ::add-matcher::ci/daos-doxygen-matcher.json
doxygen Doxyfile
echo ::remove-matcher owner=daos-doxygen::
echo ::endgroup::
6 changes: 3 additions & 3 deletions site_scons/components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,9 @@ def define_components(reqs):

retriever = GitRepoRetriever("https://github.com/pmem/pmdk.git")

pmdk_build = ["make all \"BUILD_RPMEM=n\" \"NDCTL_ENABLE=n\" "
"\"NDCTL_DISABLE=y\" $JOBS_OPT install "
"prefix=$PMDK_PREFIX"]
pmdk_build = ['make all "BUILD_RPMEM=n" "NDCTL_ENABLE=n" '
'"NDCTL_DISABLE=y" "DOC=n" $JOBS_OPT install '
'prefix=$PMDK_PREFIX']

reqs.define('pmdk',
retriever=retriever,
Expand Down
13 changes: 0 additions & 13 deletions src/include/cart/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ crt_init(crt_group_id_t grpid, uint32_t flags)
int
crt_context_create(crt_context_t *crt_ctx);


/**
* Set the timeout value for all RPC requests created on the specified context.
* Setting the timeout after crt_req_create() call will not affect already
Expand Down Expand Up @@ -1011,11 +1010,6 @@ crt_bulk_access(crt_bulk_t bulk_hdl, d_sg_list_t *sgl);
int
crt_bulk_free(crt_bulk_t bulk_hdl);

/**
* Decrease reference of the bulk handle.
*/
#define crt_bulk_decref(bulk_hdl) crt_bulk_free(bulk_hdl)

/**
* Start a bulk transferring (inside an RPC handler).
*
Expand Down Expand Up @@ -1301,7 +1295,6 @@ crt_group_config_remove(crt_group_t *grp);
int
crt_group_detach(crt_group_t *attached_grp);


/**
* Convert a primary group rank to a local subgroup rank. Given a primary group
* rank \p rank_in, find its rank number \p rank_out within a sub-group \p
Expand Down Expand Up @@ -1747,7 +1740,6 @@ crt_register_event_cb(crt_event_cb event_handler, void *arg);
int
crt_unregister_event_cb(crt_event_cb event_handler, void *arg);


typedef void
(*crt_hlc_error_cb) (void *arg);

Expand All @@ -1763,7 +1755,6 @@ typedef void
int
crt_register_hlc_error_cb(crt_hlc_error_cb event_handler, void *arg);


/**
* A protocol is a set of RPCs. A protocol has a base opcode and a version,
* member RPCs have opcodes that are contiguous numbers starting from
Expand Down Expand Up @@ -1801,7 +1792,6 @@ crt_register_hlc_error_cb(crt_hlc_error_cb event_handler, void *arg);
* sending RPCs using it's member opcodes.
*/


/**
* 1) define crf for each member RPC. my_rpc_crf_1, my_rpc_crf_2
*
Expand Down Expand Up @@ -1874,7 +1864,6 @@ int
crt_proto_query(crt_endpoint_t *tgt_ep, crt_opcode_t base_opc,
uint32_t *ver, int count, crt_proto_query_cb_t cb, void *arg);


/**
* Set self rank.
*
Expand Down Expand Up @@ -1944,7 +1933,6 @@ crt_group_rank_remove(crt_group_t *group, d_rank_t rank);
*/
int crt_self_uri_get(int tag, char **uri);


/**
* Retrieve group information containing ranks and associated uris
*
Expand Down Expand Up @@ -2101,7 +2089,6 @@ int crt_group_auto_rank_remove(crt_group_t *grp, bool enable);
*/
int crt_group_secondary_destroy(crt_group_t *grp);


/**
* Perform a primary group modification in an atomic fashion based on the
* operation specified. Currently supported operations are 'add', 'remove'
Expand Down
9 changes: 4 additions & 5 deletions src/include/daos_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,13 @@ typedef enum {
DAOS_ANCHOR_TYPE_EOF = 3,
} daos_anchor_type_t;

/** Iteration Anchor */
#define DAOS_ANCHOR_BUF_MAX 104
/** Iteration Anchor */
typedef struct {
uint16_t da_type; /** daos_anchor_type_t */
uint16_t da_type; /**< daos_anchor_type_t */
uint16_t da_shard;
uint32_t da_flags; /** see enum daos_anchor_flags */
/* record the offset for each shards for EC object */
uint64_t da_sub_anchors;
uint32_t da_flags; /**< see enum daos_anchor_flags */
uint64_t da_sub_anchors; /**< record the offset for each shards for EC object */
uint8_t da_buf[DAOS_ANCHOR_BUF_MAX];
} daos_anchor_t;

Expand Down
17 changes: 8 additions & 9 deletions utils/docker/Dockerfile.centos.7
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ RUN dnf -y install deltarpm && \
clang-analyzer \
cmake \
CUnit-devel \
doxygen \
e2fsprogs \
file \
flex \
fuse3-devel \
fuse3 \
gcc \
gcc-c++ \
git \
Expand All @@ -128,17 +128,14 @@ RUN dnf -y install deltarpm && \
Lmod \
lz4-devel \
make \
man \
maven \
meson \
nasm \
ndctl \
ninja-build \
numactl \
numactl-devel \
openmpi3-devel \
openssl-devel \
pandoc \
patch \
patchelf \
pciutils \
Expand All @@ -161,11 +158,6 @@ RUN dnf -y install deltarpm && \
yasm && \
dnf clean all

# DPDK/SPDK needs pyelftools now
# Longer term, we should upload our RPM build of this to the public packaging
# site and install it by RPM, but for now, we'll just pip install it
RUN pip3 install pyelftools

ARG UID=1000

# Add DAOS users
Expand All @@ -181,6 +173,13 @@ RUN mkdir -p /opt/daos /mnt/daos /var/run/daos_server /var/run/daos_agent && \
chown daos_server.daos_server /opt/daos /mnt/daos /var/run/daos_server && \
chown daos_agent.daos_agent /var/run/daos_agent

# DPDK/SPDK needs pyelftools now
# Longer term, we should upload our RPM build of this to the public packaging
# site and install it by RPM, but for now, we'll just pip install it
USER daos_server:daos_server
RUN pip3 --no-cache-dir --disable-pip-version-check install --user pyelftools
USER root:root

ARG QUICKBUILD=false
ARG QUICKBUILD_DEPS

Expand Down
16 changes: 7 additions & 9 deletions utils/docker/Dockerfile.centos.8
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ RUN dnf -y upgrade && \
clang-analyzer \
cmake \
CUnit-devel \
doxygen \
e2fsprogs \
file \
flex \
Expand Down Expand Up @@ -145,17 +144,14 @@ RUN dnf -y upgrade && \
Lmod \
lz4-devel \
make \
man \
maven \
meson \
nasm \
ndctl \
ninja-build \
numactl \
numactl-devel \
openmpi-devel \
openssl-devel \
pandoc \
patch \
patchelf \
pciutils \
Expand All @@ -178,11 +174,6 @@ RUN dnf -y upgrade && \
yasm && \
dnf clean all

# DPDK/SPDK needs pyelftools now
# Longer term, we should upload our RPM build of this to the public packaging
# site and install it by RPM, but for now, we'll just pip install it
RUN pip3 install pyelftools

ARG UID=1000

# Add DAOS users
Expand All @@ -198,6 +189,13 @@ RUN mkdir -p /opt/daos /mnt/daos /var/run/daos_server /var/run/daos_agent && \
chown daos_server.daos_server /opt/daos /mnt/daos /var/run/daos_server && \
chown daos_agent.daos_agent /var/run/daos_agent

# DPDK/SPDK needs pyelftools now
# Longer term, we should upload our RPM build of this to the public packaging
# site and install it by RPM, but for now, we'll just pip install it
USER daos_server:daos_server
RUN pip3 --no-cache-dir --disable-pip-version-check install --user pyelftools
USER root:root

ARG QUICKBUILD=false
ARG QUICKBUILD_DEPS

Expand Down
6 changes: 1 addition & 5 deletions utils/docker/Dockerfile.leap.15
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ RUN zypper --non-interactive --gpg-auto-import-keys --no-gpg-checks ref && \
clang \
cmake \
cunit-devel \
curl \
doxygen \
flex \
fuse3-devel \
gcc \
Expand Down Expand Up @@ -105,13 +103,11 @@ RUN zypper --non-interactive --gpg-auto-import-keys --no-gpg-checks ref && \
libyaml-devel \
lua-lmod \
make \
man \
maven \
meson \
nasm \
numactl \
ninja \
openmpi3-devel \
pandoc \
patch \
patchelf \
pciutils \
Expand Down
3 changes: 0 additions & 3 deletions utils/docker/Dockerfile.ubuntu.20.04
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ RUN apt-get -y update && \
build-essential \
clang \
cmake \
curl \
doxygen \
fuse3 \
git \
golang-go \
Expand Down Expand Up @@ -52,7 +50,6 @@ RUN apt-get -y update && \
numactl \
ninja-build \
openjdk-8-jdk \
pandoc \
patchelf \
pciutils \
pkg-config \
Expand Down

0 comments on commit 537e2b7

Please sign in to comment.