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

让Github Action在你自己的机器上跑起来 #85

Open
Yikun opened this issue Apr 17, 2020 · 0 comments
Open

让Github Action在你自己的机器上跑起来 #85

Yikun opened this issue Apr 17, 2020 · 0 comments

Comments

@Yikun
Copy link
Owner

Yikun commented Apr 17, 2020

Github在2019年8月,宣布推出了一项新的功能——Github Action,让成千上万的开源项目可以利用Github提供的计算资源完成构建、测试、部署等CI/CD,并且提供Self Hosted Runners功能,让开发者们可以将自己的机器接入到Github中来。

最近,我们利用这一功能,将搭载着openEuler 20.03 (LTS) 操作系统,跑在Kunpeng 920 处理器的ARM环境接入进来,在近期华为与阿里合作的MPAM项目,也将充分的利用这些资源利用Github Action的能力完成构建与测试。

本篇文章将接入方法分享给大家,希望能够帮助更多同学们把自己的ARM环境也在Github上用起来。

1. 接入资源

image
资源的接入流程比较简单:

  1. 依次点击项目的Settings--Actions进入资源接入页面,点击Add Runner

  2. 根据弹出的提示,下载和运行脚本
    image

  3. 完成后我们可以看到接入的资源:
    image

2. 使用资源

image
我们为接入的项目增加一个Action:

name: Run some script in Kunpeng env

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    runs-on: self-hosted

    steps:
    # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
    - uses: actions/checkout@v2

    - name: Run `uname -a` in Kunpeng env
      run: |
        uname -a
        cat /etc/os-release
        lscpu | grep -E "Architecture|Model name|CPU\(s\):"

这样,这个workflow是展示所接入的环境上内核、操作系统、处理器信息,我们可以从结果看到job的结果:
image

点击Details可以进入详情页面:

image

可以看到,我们在资源上执行的指令,已经运行成功,可以看到这台资源的系统为openEuler 20.03 (LTS),CPU为aarch64 128核的Kunpeng 920

3.结语

本文介绍了我们是如何将搭载着鲲鹏920处理器、openEuler操作系统的计算资源接入到Github Action的。可以看到Github Action的自定义资源接入,在ARM64下还是很顺滑的。

希望这篇文章能够帮助到大家,大家也可以尝试着将你们自己ARM资源接入进来,有问题可以留言一起讨论,玩的开心!:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant