-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add entrypoint and cleanup scripts for github action
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
- Loading branch information
1 parent
0c466f7
commit 7a6db4c
Showing
3 changed files
with
78 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
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,29 @@ | ||
## Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.## | ||
## Licensed under the Apache License, Version 2.0 (the "License"); | ||
## you may not use this file except in compliance with the License. | ||
## You may obtain a copy of the License at | ||
## | ||
## http://www.apache.org/licenses/LICENSE-2.0 | ||
## | ||
## Unless required by applicable law or agreed to in writing, software | ||
## distributed under the License is distributed on an "AS IS" BASIS, | ||
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
## See the License for the specific language governing permissions and | ||
## limitations under the License. | ||
## | ||
|
||
#! /usr/bin/env bash | ||
set +x | ||
|
||
export DEBIAN_FRONTEND=noninteractive | ||
|
||
if [ ! -d /github/workspace/.cache ]; then | ||
echo "Cache directory not found in /workspace" | ||
exit 1 | ||
fi | ||
|
||
/user/bin/holodeck delete -f /github/workspace/$INPUT_HOLODECK_CONFIG -c /github/workspace/.cache | ||
|
||
rm -rf /github/workspace/.cache | ||
rm -f /github/workspace/key.pem | ||
rm -f /github/workspace/kubeconfig |
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,44 @@ | ||
## Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.## | ||
## Licensed under the Apache License, Version 2.0 (the "License"); | ||
## you may not use this file except in compliance with the License. | ||
## You may obtain a copy of the License at | ||
## | ||
## http://www.apache.org/licenses/LICENSE-2.0 | ||
## | ||
## Unless required by applicable law or agreed to in writing, software | ||
## distributed under the License is distributed on an "AS IS" BASIS, | ||
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
## See the License for the specific language governing permissions and | ||
## limitations under the License. | ||
## | ||
|
||
#! /usr/bin/env bash | ||
set +x | ||
|
||
export DEBIAN_FRONTEND=noninteractive | ||
|
||
if [ -n "$INPUT_HOLODECK_CONFIG" ]; then | ||
if [ ! -f "/github/workspace/$INPUT_HOLODECK_CONFIG" ]; then | ||
echo "Holodeck config file not found in /workspace" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
if [ -z "$INPUT_AWS_ACCESS_KEY_ID" ] || [ -z "$INPUT_AWS_SECRET_ACCESS_KEY" ]; then | ||
echo "AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are not set" | ||
exit 1 | ||
fi | ||
|
||
export AWS_ACCESS_KEY_ID=$INPUT_AWS_ACCESS_KEY_ID | ||
export AWS_SECRET_ACCESS_KEY=$INPUT_AWS_SECRET_ACCESS_KEY | ||
|
||
if [ -n "$SSH_KEY" ]; then | ||
$(umask 077; echo "$SSH_KEY" > /github/workspace/key.pem) | ||
fi | ||
|
||
mkdir -p /github/workspace/.cache | ||
|
||
/user/local/bin/holodeck create --provision \ | ||
-f /github/workspace/$INPUT_HOLODECK_CONFIG \ | ||
-c /github/workspace/.cache \ | ||
-k /github/workspace/kubeconfig |