diff --git a/.github/workflows/test_build_on_cpu_and_gpu.yml b/.github/workflows/test_build_on_cpu_and_gpu.yml new file mode 100644 index 000000000..287240943 --- /dev/null +++ b/.github/workflows/test_build_on_cpu_and_gpu.yml @@ -0,0 +1,64 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python package + +on: [push, pull_request] + +jobs: + build_cpu: + runs-on: linux.2xlarge + + steps: + + - name: check cpu info + shell: bash + run: | + cat /proc/cpuinfo + + - name: Display EC2 information + shell: bash + run: | + set -euo pipefail + function get_ec2_metadata() { + # Pulled from instance metadata endpoint for EC2 + # see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html + category=$1 + curl -fsSL "http://169.254.169.254/latest/meta-data/${category}" + } + echo "ami-id: $(get_ec2_metadata ami-id)" + echo "instance-id: $(get_ec2_metadata instance-id)" + echo "instance-type: $(get_ec2_metadata instance-type)" + + build_gpu: + runs-on: linux.8xlarge.nvidia.gpu + steps: + - name: check cpu info + shell: bash + run: | + cat /proc/cpuinfo + + - name: Display EC2 information + shell: bash + run: | + set -euo pipefail + function get_ec2_metadata() { + # Pulled from instance metadata endpoint for EC2 + # see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html + category=$1 + curl -fsSL "http://169.254.169.254/latest/meta-data/${category}" + } + echo "ami-id: $(get_ec2_metadata ami-id)" + echo "instance-id: $(get_ec2_metadata instance-id)" + echo "instance-type: $(get_ec2_metadata instance-type)" + + - name: check gpu info + shell: bash + run: | + pip install lshw + sudo lshw -C display + + - name: check nvidia info + shell: bash + run: | + nvidia-smi