-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add builds for sles in github actions (#2048)
- Loading branch information
Showing
4 changed files
with
138 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -170,6 +170,71 @@ jobs: | |
git config --global --add safe.directory /data | ||
python3 tools/format.py origin/${{ github.event_name == 'pull_request' && github.base_ref || 'develop' }} | ||
|
||
sles: | ||
runs-on: ROCM-Ubuntu | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# In this step, this action saves a list of existing images, | ||
# the cache is created without them in the post run. | ||
# It also restores the cache if it exists. | ||
- name: Docker layer cache | ||
uses: jpribyl/[email protected] | ||
with: | ||
key: docker-layer-caching-migraphx-sles-${{hashFiles('hip-clang.docker', '**/*requirements.txt', '**/install_prereqs.sh', 'rbuild.ini')}} | ||
restore-keys: | ||
docker-layer-caching-migraphx-sles- | ||
# Ignore the failure of a step and avoid terminating the job. | ||
continue-on-error: true | ||
|
||
- name: Build the Docker image | ||
run: docker build . --file tools/docker/sles.docker --tag migraphx-sles | ||
|
||
- name: Restore cache files for ccache | ||
uses: actions/cache/restore@v3 | ||
id: ccache_restore | ||
with: | ||
path: ${{ github.workspace }}/ccache | ||
key: ccache-sles-${{ github.ref }} | ||
restore-keys: ccache-sles- | ||
|
||
- name: Build migraphx | ||
shell: bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data migraphx-sles bash < {0}" | ||
run: | | ||
set -e | ||
export CCACHE_COMPRESSLEVEL=10 | ||
export CCACHE_DIR=/data/ccache | ||
export CCACHE_NOHASHDIR=true | ||
export CCACHE_BASEDIR=/data | ||
export CCACHE_MAXSIZE=1 | ||
mkdir build | ||
cd build | ||
CXX=/opt/rocm/llvm/bin/clang++ CC=/opt/rocm/llvm/bin/clang cmake \ | ||
-DBUILD_DEV=On \ | ||
-DCMAKE_CXX_COMPILER_LAUNCHER=/usr/local/bin/ccache \ | ||
-DCMAKE_C_COMPILER_LAUNCHER=/usr/local/bin/ccache \ | ||
.. | ||
make -j$(nproc) tests driver | ||
|
||
- name: Clear ccache cache before saving | ||
if: ${{ steps.ccache_restore.outputs.cache-hit }} | ||
shell: bash | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
set +x | ||
gh extension install actions/gh-actions-cache --pin v1.0.1 | ||
gh actions-cache delete ${{ steps.ccache_restore.outputs.cache-matched-key }} --confirm | ||
|
||
- name: Save cache files for ccache | ||
uses: actions/cache/save@v3 | ||
if: always() | ||
with: | ||
path: ${{ github.workspace }}/ccache | ||
key: ccache-sles-${{ github.ref }} | ||
|
||
pyflakes: | ||
runs-on: ubuntu-20.04 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
FROM registry.suse.com/suse/sle15:15.4 | ||
|
||
RUN sh -c 'echo -e "\ | ||
[rocm]\n\ | ||
name=rocm\n\ | ||
baseurl=https://repo.radeon.com/rocm/zyp/5.5/main\n\ | ||
enabled=1\n\ | ||
gpgcheck=1\n\ | ||
gpgkey=https://repo.radeon.com/rocm/rocm.gpg.key\n\ | ||
" > /etc/zypp/repos.d/rocm.repo' | ||
|
||
RUN cat /etc/zypp/repos.d/rocm.repo | ||
|
||
RUN zypper -n --gpg-auto-import-keys refresh | ||
|
||
RUN zypper install -y -t pattern devel_basis enhanced_base | ||
RUN zypper --gpg-auto-import-keys install -y \ | ||
doxygen \ | ||
gcc-c++ \ | ||
gdb \ | ||
git \ | ||
python3-pip | ||
|
||
# Workaround broken rocm packages | ||
RUN ln -s /opt/rocm-* /opt/rocm | ||
RUN echo "/opt/rocm/lib" > /etc/ld.so.conf.d/rocm.conf | ||
RUN echo "/opt/rocm/llvm/lib" > /etc/ld.so.conf.d/rocm-llvm.conf | ||
RUN ldconfig | ||
|
||
ENV LC_ALL=C.UTF-8 | ||
ENV LANG=C.UTF-8 | ||
|
||
# Install yapf | ||
RUN pip3 install yapf==0.28.0 | ||
|
||
# Install doc requirements | ||
# ADD docs/.sphinx/requirements.txt /doc-requirements.txt | ||
# RUN pip3 install -r /doc-requirements.txt | ||
|
||
# Install dependencies | ||
ADD dev-requirements.txt /dev-requirements.txt | ||
ADD requirements.txt /requirements.txt | ||
ADD rbuild.ini /rbuild.ini | ||
|
||
COPY ./tools/install_prereqs.sh / | ||
RUN /install_prereqs.sh /usr/local / && rm /install_prereqs.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters