diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 8b259e078..c9efc8453 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -1,79 +1,93 @@ -name: vHive integration tests +name: Build and Test OpenYurt Deployer on: - push: - branches: [ main, legacy-firecracker-v0.24.0-with-upf-support ] - paths-ignore: - - 'docs/**' - - '**.md' - - 'function-images/**' - pull_request: - branches: [ main, legacy-firecracker-v0.24.0-with-upf-support, openyurt ] - paths-ignore: - - 'docs/**' - - '**.md' - - 'function-images/**' - workflow_dispatch: - schedule: - - cron: '0 19 * * 1' + push: + branches: [ main, legacy-firecracker-v0.24.0-with-upf-support ] + paths-ignore: + - 'docs/**' + - '**.md' + pull_request: + branches: [ main, legacy-firecracker-v0.24.0-with-upf-support, openyurt ] + paths-ignore: + - 'docs/**' + - '**.md' + workflow_dispatch: env: - GOOS: linux - GO111MODULE: on + GOOS: linux + GO111MODULE: on jobs: - integration-tests: - name: Integration tests - runs-on: [self-hosted , integ] - strategy: - fail-fast: false - matrix: - test-name: [test, test-man-bench] - steps: + build_openyurt: + runs-on: ubuntu-latest + + services: + myservice: + image: ubuntu:latest + ports: + - 22/tcp + options: --name myservice + steps: - name: Set up Go 1.19 uses: actions/setup-go@v4 with: go-version: '1.19' - - name: Set up Python 3.x - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - - name: Upgrade git + - name: Check out the code + uses: actions/checkout@v4 + + - name: Connect to service container run: | - sudo add-apt-repository ppa:git-core/ppa -y - sudo apt update - sudo apt install git -y + sleep 10 + SERVICE_IP=$(docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' myservice) + echo $SERVICE_IP - - name: Check out code into the Go module directory - uses: actions/checkout@v4 - with: - lfs: true - - - name: Build setup scripts - run: pushd scripts && go build -o setup_tool && popd - - - name: Pull binaries - run: ./scripts/setup_tool setup_firecracker_containerd - - - name: Build - run: go build -race -v -a ./... - - - name: Run vHive end-to-end tests - run: make ${{ matrix.test-name }} - - - name: Archive log artifacts - if: ${{ always() }} - uses: actions/upload-artifact@v3 - with: - name: ctrd-logs - path: | - /tmp/ctrd-logs/ - ${{ github.workspace }}/*.log - ${{ github.workspace }}/scripts/github_runner/*.log - - - name: Cleaning - if: ${{ always() }} - run: ./scripts/setup_tool clean_fcctr + - name: modify JSON conf + uses: restackio/update-json-file-action@v2.0 + with: + file: scripts/openyurt-deployer/conf.json + fields: "{\"master\": \"runner@127.0.0.1\", \"workers\": {\"cloud\": [], \"edge\": [] }}" + + - name: Build scripts + run: + pushd scripts/openyurt-deployer && go build -o oy_deploy && popd + + - name: Show scripts help info + run: + ./scripts/openyurt-deployer/oy_deploy help + + - name: Allow root login + run: | + echo "PermitRootLogin=yes" | sudo tee -a /etc/ssh/sshd_config + + - name: Set up SSH and run deploy + run: | + echo $USER + + sudo apt-get update + sudo apt-get install -y openssh-server + sudo service ssh start + eval "$(ssh-agent -s)" + + ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa -N "" + cat > ~/.ssh/config < ~/.ssh/authorized_keys + + sudo service ssh restart + service ssh status + + ssh-add ~/.ssh/id_rsa + + cat ~/.ssh/authorized_keys + chmod og-rw ~/.ssh + + cd scripts/openyurt-deployer + ./oy_deploy kube + ./oy_deploy knative