Skip to content

Commit

Permalink
Remove redundant installations, cache all and use fixed ansible version
Browse files Browse the repository at this point in the history
  • Loading branch information
masih committed Sep 9, 2024
1 parent 1af0aa3 commit 07c169f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
10 changes: 5 additions & 5 deletions .github/actions/lotus-ansible-prepare/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,20 @@ runs:
aws-secret-access-key: ${{ inputs.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ inputs.AWS_REGION }}

- uses: actions-rust-lang/setup-rust-toolchain@v1

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- uses: actions/setup-go@v5
- name: "Cache python packages"
uses: actions/cache@v4
with:
go-version: "1.21.7"
path: ~/.cache/pip
key: ${{ runner.os }}-3_12

- name: Install Ansible Playbook
shell: bash
run: |
pip install ansible
python -m pip install ansible==2.17.1
- name: Clone Lotus Repository
uses: actions/checkout@v4
Expand Down
25 changes: 16 additions & 9 deletions .github/actions/lotus-ansible-reset/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,27 @@ runs:
- name: Check environment
shell: bash
run: |
if [ -z "$GOPATH" ]; then
echo "::error::GOPATH is not set"
exit 1
fi
if [ -z "$LOTUSROOT" ]; then
echo "::error::LOTUSROOT is not set"
exit 1
fi
- name: Cache libhwloc
uses: actions/cache@v4
id: cache-libhwloc
with:
path: '/usr/lib/x86_64-linux-gnu/libhwloc.so.*'
key: libhwloc
- name: Setup environment
env:
CACHE_HIT: ${{steps.cache-libhwloc.outputs.cache-hit}}
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y libhwloc-dev ocl-icd-opencl-dev pkg-config
sudo ln -s /usr/lib/x86_64-linux-gnu/libhwloc.so.15 /usr/lib/x86_64-linux-gnu/libhwloc.so.5
# Only install libhwloc if not cached.
if [[ "${CACHE_HIT}" != 'true' ]]; then
sudo apt-get update
sudo apt-get install -y libhwloc-dev ocl-icd-opencl-dev pkg-config
sudo ln -s /usr/lib/x86_64-linux-gnu/libhwloc.so.15 /usr/lib/x86_64-linux-gnu/libhwloc.so.5
fi
# Infer deploy network from network name to reduce unnecessary noise in actions inputs.
DEPLOY_NETWORK=$(
case ${{ inputs.network }} in
Expand All @@ -66,8 +73,8 @@ runs:
context: ${{ env.LOTUSROOT }}
push: false
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
# cache-from: type=gha
# cache-to: type=gha,mode=max
build-args: |
GOFLAGS=-tags=${{ env.NETWORK }}
- name: Copy binaries from built container
Expand Down

0 comments on commit 07c169f

Please # to comment.