Skip to content

Squashed commit of the following: #125

Squashed commit of the following:

Squashed commit of the following: #125

name: Python Package using Conda
on: [push, pull_request, workflow_dispatch]
# push:
# branches: ["master"]
# pull_request:
# branches: ["master"]
# workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
max-parallel: 20
matrix:
os: [ubuntu-20.04, ubuntu-18.04]
python-version: ['3.10', '3.9', '3.8', '3.7', '3.6', '3.5']
experimental: [false]
include:
- os: windows-latest
python-version: '3.9'
experimental: true
- os: macos-latest
python-version: '3.9'
experimental: true
name: Python ${{ matrix.python-version }}/${{ matrix.os }}
steps:
- uses: actions/checkout@v2
# - name: Set up Conda
# uses: s-weigand/setup-conda@v1
# with:
# update-conda: true
# python-version: ${{ matrix.python-version }}
# conda-channels: anaconda
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Ensure ssh is installed
run: sudo apt update; sudo apt -y install openssh-server
- name: Check config
run: |
cat > sshd_config <<EOF
SyslogFacility AUTHPRIV
PermitRootLogin yes
AuthorizedKeysFile .ssh/authorized_keys
PasswordAuthentication yes
ChallengeResponseAuthentication no
UsePAM yes
UseDNS no
X11Forwarding no
PrintMotd no
EOF
sudo mv sshd_config /etc/ssh/sshd_config
sudo systemctl restart ssh
- name: Create ssh key
run: >
ssh-keygen -t rsa -b 4096 -N '' -f ~/.ssh/id_rsa
- name: Add key to auth file
run: >
cat ~/.ssh/id_rsa.pub | tee -a ~/.ssh/authorized_keys
- name: Ensure the owner of the key is correct
run: |
chmod 600 ~/.ssh/authorized_keys
chmod 700 ~/.ssh
sudo chmod -c 0755 ~/
ls -la ~/.ssh
- name: Test SSH connection to localhost
run: >
ssh -vvv -i ~/.ssh/id_rsa -o BatchMode=yes -o StrictHostKeyChecking=no $(whoami)@localhost
# - run: sudo apt-get install openssh-server -y; echo |ssh-keygen -t rsa;ls ~/.ssh;echo "valva"; cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys;ls ~/.ssh; ssh -i ~/.ssh/id_rsa -oStrictHostKeyChecking=no localhost pwd
- run: whoami
- run: pip install -e .
- run: drm4g start
- run: drm4g resource
- run: echo "EXECUTABLE=/bin/date" > date.job
- run: sleep 10
- run: drm4g job submit date.job
- run: drm4g resource
- run: sleep 10
- run: drm4g job list 0
- run: sleep 50
- run: drm4g job list 0
- run: cat stdout.0
- run: drm4g stop
- run: cp ~/.drm4g/etc/resources_ssh.conf ~/.drm4g/etc/resources.conf
- run: drm4g start
- run: sleep 30; drm4g resource check
- run: drm4g job submit date.job
- run: drm4g resource
- run: sleep 10
- run: drm4g job list 1
- run: sleep 50
- run: drm4g job list 1
- run: cat stdout.1
- name: Test python API
run: >
python extras/examples/test_api.py