Skip to content

Commit

Permalink
Merge pull request #5267 from amaslenn/topic/ci-rpm-spec-sync-v1.8
Browse files Browse the repository at this point in the history
CI/RPM/SPEC: sync with master - v1.8.x
  • Loading branch information
yosefe authored Jun 12, 2020
2 parents 89c592d + 6ba627a commit 49982d4
Show file tree
Hide file tree
Showing 13 changed files with 371 additions and 123 deletions.
78 changes: 78 additions & 0 deletions buildlib/az-distro-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
jobs:
- job: distro_release
displayName: distro

pool:
name: MLNX
demands:
- harbor_registry -equals yes

strategy:
matrix:
centos7_cuda10_1:
build_container: centos7_cuda10_1
artifact_name: ucx-${{ replace(variables['Build.SourceBranch'], 'refs/tags/', '') }}-centos7-mofed5.0-cuda10.1.tar.bz2
centos7_cuda10_2:
build_container: centos7_cuda10_2
artifact_name: ucx-${{ replace(variables['Build.SourceBranch'], 'refs/tags/', '') }}-centos7-mofed5.0-cuda10.2.tar.bz2
ubuntu16_cuda10_1:
build_container: ubuntu16_cuda10_1
artifact_name: ucx-${{ replace(variables['Build.SourceBranch'], 'refs/tags/', '') }}-ubuntu16.04-mofed5.0-cuda10.1.deb
ubuntu16_cuda10_2:
build_container: ubuntu16_cuda10_2
artifact_name: ucx-${{ replace(variables['Build.SourceBranch'], 'refs/tags/', '') }}-ubuntu16.04-mofed5.0-cuda10.2.deb
ubuntu18_cuda10_1:
build_container: ubuntu18_cuda10_1
artifact_name: ucx-${{ replace(variables['Build.SourceBranch'], 'refs/tags/', '') }}-ubuntu18.04-mofed5.0-cuda10.1.deb
ubuntu18_cuda10_2:
build_container: ubuntu18_cuda10_2
artifact_name: ucx-${{ replace(variables['Build.SourceBranch'], 'refs/tags/', '') }}-ubuntu18.04-mofed5.0-cuda10.2.deb

container: $[ variables['build_container'] ]

steps:
- checkout: self
clean: true
path: "we/need/to/go/deeper"
# ^ Avoid rpmbuild error: Dest dir longer than base dir is not supported

- bash: |
set -eE
./autogen.sh
./contrib/configure-release --with-cuda
displayName: Configure
- bash: |
set -eE
./contrib/buildrpm.sh -s -t -b --strict-ibverbs-dep
cd rpm-dist/`uname -m`
tar -cjf "../../${AZ_ARTIFACT_NAME}" *.rpm
cd ../..
ls -l "${AZ_ARTIFACT_NAME}"
tar -tjf "${AZ_ARTIFACT_NAME}"
displayName: Build RPM package
condition: and(succeeded(), contains(variables['artifact_name'], 'centos'))
env:
AZ_ARTIFACT_NAME: $(artifact_name)
- bash: |
set -eE
dpkg-buildpackage -us -uc
find .. -name '*.deb' -exec cp {} "${AZ_ARTIFACT_NAME}" \;
ls -l "${AZ_ARTIFACT_NAME}"
displayName: Build DEB package
condition: and(succeeded(), contains(variables['artifact_name'], 'ubuntu'))
env:
AZ_ARTIFACT_NAME: $(artifact_name)
- task: GithubRelease@0
displayName: Upload artifacts to draft release
inputs:
githubConnection: release
repositoryName: openucx/ucx
action: edit
tag: $(Build.SourceBranchName)
isDraft: true
addChangeLog: false
assetUploadMode: replace
assets: "./$(artifact_name)"
4 changes: 2 additions & 2 deletions buildlib/azure-pipelines-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ resources:
image: ucfconsort.azurecr.io/ucx/centos7:1
endpoint: ucfconsort_registry
- container: fedora
image: ucfconsort.azurecr.io/ucx/fedora:1
image: ucfconsort.azurecr.io/ucx/fedora:2
endpoint: ucfconsort_registry

stages:
Expand All @@ -32,7 +32,7 @@ stages:
for sha1 in `git log $range --format="%h"`
do
title=`git log -1 --format="%s" $sha1`
if echo $title | grep -qP '^Merge |^[0-9A-Z/_]*: \w'
if echo $title | grep -qP '^Merge |^[0-9A-Z/_\-]*: \w'
then
echo "Good commit title: '$title'"
else
Expand Down
72 changes: 33 additions & 39 deletions buildlib/azure-pipelines-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,42 @@ trigger:

resources:
containers:
- container: fedora
image: ucfconsort.azurecr.io/ucx/fedora:1
- container: centos7
image: ucfconsort.azurecr.io/ucx/centos7:1
endpoint: ucfconsort_registry
- container: centos7_cuda10_1
image: rdmz-harbor.rdmz.labs.mlnx/ucx/centos7-mofed5.0-cuda10.1:1
- container: centos7_cuda10_2
image: rdmz-harbor.rdmz.labs.mlnx/ucx/centos7-mofed5.0-cuda10.2:1
- container: ubuntu16_cuda10_1
image: rdmz-harbor.rdmz.labs.mlnx/ucx/ubuntu16.04-mofed5.0-cuda10.1:1
- container: ubuntu16_cuda10_2
image: rdmz-harbor.rdmz.labs.mlnx/ucx/ubuntu16.04-mofed5.0-cuda10.2:1
- container: ubuntu18_cuda10_1
image: rdmz-harbor.rdmz.labs.mlnx/ucx/ubuntu18.04-mofed5.0-cuda10.1:1
- container: ubuntu18_cuda10_2
image: rdmz-harbor.rdmz.labs.mlnx/ucx/ubuntu18.04-mofed5.0-cuda10.2:1

stages:
- stage: Release
# Create an empty draft to avoid race condition in distro releases
- stage: GitHubDraft
jobs:
- job: release
displayName: build tarball and source rpm
container: fedora
- job: DraftRelease
steps:
- checkout: self
clean: true

- bash: ./autogen.sh
displayName: Setup autotools

- bash: |
set -eE
gcc --version
./contrib/configure-release --with-java
./contrib/buildrpm.sh -s -t -b
displayName: Build tarball
- task: GithubRelease@0
displayName: Create/edit GitHub Draft Release
inputs:
githubConnection: release
repositoryName: openucx/ucx
action: edit
tag: $(Build.SourceBranchName)
isDraft: true
addChangeLog: false
assets: |
./ucx-*.tar.gz
./rpm-dist/ucx-*.src.rpm
- task: GithubRelease@0
displayName: Create/edit GitHub Draft Release
inputs:
githubConnection: release
repositoryName: openucx/ucx
action: edit
tag: $(Build.SourceBranchName)
isDraft: true
addChangeLog: false
assetUploadMode: replace

- bash: |
set -eE
make -s -j`nproc`
displayName: Build ucx
- template: jucx-publish.yml
parameters:
target: publish-release
- stage: Release
jobs:
- template: az-distro-release.yml
- template: jucx-publish.yml
parameters:
target: publish-release
13 changes: 13 additions & 0 deletions buildlib/azure-pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,16 @@ $ docker run --rm -ti -v `pwd`:`pwd` -w `pwd` ucfconsort.azurecr.io/ucx/centos7:
```

This will duplicate what will happen when running inside AZP.

# Release images
To build release images there is a `docker-compose` config. Here is how to use it:
```sh
cd buildlib
docker-compose build
```

Tag and push release images:
```sh
./buildlib/push-release-images.sh
```

27 changes: 5 additions & 22 deletions buildlib/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,13 @@ trigger:

resources:
containers:
- container: fedora
image: ucfconsort.azurecr.io/ucx/fedora:1
- container: centos7
image: ucfconsort.azurecr.io/ucx/centos7:1
endpoint: ucfconsort_registry

stages:
- stage: Build
jobs:
# Publish JUCX to maven central
- job: publish_jucx
displayName: Publish JUCX SNAPSHOT artifact to maven central
container: fedora
steps:
- checkout: self
clean: true

- bash: ./autogen.sh
displayName: Setup autotools

- bash: |
set -eE
./contrib/configure-release --with-java
make -s -j`nproc`
displayName: Build ucx
- template: jucx-publish.yml
parameters:
target: publish-snapshot
- template: jucx-publish.yml
parameters:
target: publish-snapshot
46 changes: 46 additions & 0 deletions buildlib/centos7-release.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
ARG CUDA_VERSION=10.1
FROM nvidia/cuda:${CUDA_VERSION}-devel-centos7

RUN yum install -y \
autoconf \
automake \
doxygen \
file \
gcc-c++ \
git \
glibc-devel \
libtool \
make \
maven \
numactl-devel \
rdma-core-devel \
rpm-build \
tcl \
tcsh \
tk \
wget \
&& yum clean all

# MOFED
ARG MOFED_VERSION=5.0-1.0.0.0
ARG MOFED_OS=rhel7.6
ENV MOFED_DIR MLNX_OFED_LINUX-${MOFED_VERSION}-${MOFED_OS}-x86_64
ENV MOFED_SITE_PLACE MLNX_OFED-${MOFED_VERSION}
ENV MOFED_IMAGE ${MOFED_DIR}.tgz
RUN wget --no-verbose http://content.mellanox.com/ofed/${MOFED_SITE_PLACE}/${MOFED_IMAGE} && \
tar -xzf ${MOFED_IMAGE} && \
${MOFED_DIR}/mlnxofedinstall --all -q \
--user-space-only \
--without-fw-update \
--skip-distro-check \
--without-ucx \
--without-hcoll \
--without-openmpi \
--without-sharp \
&& rm -rf ${MOFED_DIR} && rm -rf *.tgz

ENV CPATH /usr/local/cuda/include:${CPATH}
ENV LD_LIBRARY_PATH /usr/local/cuda/lib64:/usr/local/cuda/compat:${LD_LIBRARY_PATH}
ENV LIBRARY_PATH /usr/local/cuda/lib64:/usr/local/cuda/compat:${LIBRARY_PATH}
ENV PATH /usr/local/cuda/compat:${PATH}

58 changes: 58 additions & 0 deletions buildlib/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
version: "3"

services:
centos7-mofed5.0-cuda10.1:
image: centos7-mofed5.0-cuda10.1
build:
context: .
dockerfile: centos7-release.Dockerfile
args:
MOFED_VERSION: 5.0-1.0.0.0
MOFED_OS: rhel7.6
CUDA_VERSION: 10.1
centos7-mofed5.0-cuda10.2:
image: centos7-mofed5.0-cuda10.2
build:
context: .
dockerfile: centos7-release.Dockerfile
args:
MOFED_VERSION: 5.0-1.0.0.0
MOFED_OS: rhel7.6
CUDA_VERSION: 10.2
ubuntu16.04-mofed5.0-cuda10.1:
image: ubuntu16.04-mofed5.0-cuda10.1
build:
context: .
dockerfile: ubuntu-release.Dockerfile
args:
MOFED_VERSION: 5.0-1.0.0.0
UBUNTU_VERSION: 16.04
CUDA_VERSION: 10.1
ubuntu16.04-mofed5.0-cuda10.2:
image: ubuntu16.04-mofed5.0-cuda10.2
build:
context: .
dockerfile: ubuntu-release.Dockerfile
args:
MOFED_VERSION: 5.0-1.0.0.0
UBUNTU_VERSION: 16.04
CUDA_VERSION: 10.2
ubuntu18.04-mofed5.0-cuda10.1:
image: ubuntu18.04-mofed5.0-cuda10.1
build:
context: .
dockerfile: ubuntu-release.Dockerfile
args:
MOFED_VERSION: 5.0-1.0.0.0
UBUNTU_VERSION: 18.04
CUDA_VERSION: 10.1
ubuntu18.04-mofed5.0-cuda10.2:
image: ubuntu18.04-mofed5.0-cuda10.2
build:
context: .
dockerfile: ubuntu-release.Dockerfile
args:
MOFED_VERSION: 5.0-1.0.0.0
UBUNTU_VERSION: 18.04
CUDA_VERSION: 10.2

1 change: 1 addition & 0 deletions buildlib/fedora.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RUN dnf install -y \
gcc-c++ \
git \
glibc-devel \
java-1.8.0-openjdk-devel \
libtool \
make \
maven \
Expand Down
Loading

0 comments on commit 49982d4

Please sign in to comment.