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

Use configFile option, support an additional repo deploy key #175

Merged
merged 21 commits into from
Mar 8, 2024
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 24 additions & 12 deletions .github/workflows/build-in-devcontainer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ on:
inputs:
sha:
type: string
arch:
type: string
default: '["amd64"]'
cuda:
type: string
default: '["12.0"]'
repo:
type: string
node_type:
Expand All @@ -16,6 +22,11 @@ on:
required: false
type: string
default: ''
# Note that this is the _name_ of a secret containing the key, not the key itself.
extra-repo-deploy-key-2:
required: false
type: string
default: ''

permissions:
actions: read
Expand All @@ -37,8 +48,8 @@ jobs:
strategy:
fail-fast: false
matrix:
arch: ["amd64"]
cuda: ["12.0"]
arch: ${{ fromJSON(inputs.arch) }}
cuda: ${{ fromJSON(inputs.cuda) }}
pkgr: ["conda", "pip"]
runs-on: "linux-${{ matrix.arch }}-${{ inputs.node_type }}"
steps:
Expand All @@ -53,6 +64,7 @@ jobs:
fetch-depth: 0
- name: Check if repo has devcontainer
run: |
echo "REPOSITORY=$(basename $(pwd))" | tee -a "${GITHUB_ENV}";
if test -f .devcontainer/cuda${{ matrix.cuda }}-${{ matrix.pkgr }}/devcontainer.json; then
echo "HAS_DEVCONTAINER=true" >> "${GITHUB_ENV}";
else
Expand All @@ -69,17 +81,12 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: '16'
- if: ${{ env.HAS_DEVCONTAINER == 'true' }}
name: Copy devcontainer.json file up one level
run: |
echo "REPOSITORY=$(basename $(pwd))" | tee -a "${GITHUB_ENV}";
cp .devcontainer/cuda${{ matrix.cuda }}-${{ matrix.pkgr }}/devcontainer.json \
.devcontainer/devcontainer.json;
- if: ${{ env.HAS_DEVCONTAINER == 'true' }}
name: Run build in devcontainer
uses: devcontainers/[email protected]
with:
push: never
configFile: .devcontainer/cuda${{ matrix.cuda }}-${{ matrix.pkgr }}/devcontainer.json
env: |
REPOSITORY=${{ env.REPOSITORY }}
SCCACHE_REGION=${{ vars.AWS_REGION }}
Expand All @@ -88,18 +95,23 @@ jobs:
AWS_SECRET_ACCESS_KEY=${{ env.AWS_SECRET_ACCESS_KEY }}
runCmd: |
set -e;

mkdir -p ~/.config/pip/;
cat <<EOF >> ~/.config/pip/pip.conf
[global]
extra-index-url = https://pypi.anaconda.org/rapidsai-wheels-nightly/simple
EOF

rapids-make-${PYTHON_PACKAGE_MANAGER}-env || true;
rapids-make-${PYTHON_PACKAGE_MANAGER}-env;
trxcllnt marked this conversation as resolved.
Show resolved Hide resolved

if ! grep -qE "^$" <<< "${{ inputs.extra-repo-deploy-key }}"; then
if test -n '${{ inputs.extra-repo-deploy-key }}' \
|| test -n '${{ inputs.extra-repo-deploy-key-2 }}'; then
if ! pgrep ssh-agent >/dev/null 2>&1; then eval "$(ssh-agent -s)"; fi;
ssh-add - <<< "${{ secrets[inputs.extra-repo-deploy-key] }}";
if test -n '${{ inputs.extra-repo-deploy-key }}'; then
ssh-add - <<< '${{ secrets[inputs.extra-repo-deploy-key] }}';
fi
if test -n '${{ inputs.extra-repo-deploy-key-2 }}'; then
ssh-add - <<< '${{ secrets[inputs.extra-repo-deploy-key-2] }}';
fi
devcontainer-utils-init-ssh-deploy-keys || true;
fi

Expand Down