OpenHarmony mirror
Summary
Oniro WG decided to mirror OpenHarmony code base. The whole set consists of ~700 repositories. The mirrored code is expected to be hosted in GitHub within a space managed by Eclipse Foundation.
We request setting up a one-way mirror from Gitee to GitHub.
The Oniro team performed tests using GitHub action.
There's missing lfs
support that the team plans to develop.
The limitations of free GitHub runners break the synchronization process so own runner is needed. More details below.
Steps to reproduce
- A repo needs to be created in group / organization to hold the workflow yml file for GitHub actions.
- The example we used can be found here.
- As seen in line 12 and 13 this runs on a self-hosted runner. Without it, we would run into resource limits for space as well as time. For our test we just followed the guide to add a self-hosted runner to a single repository. This will most likely be different on your setup. In terms of resources, the runner does not need much. Around 80 GB of storage and 16-20 GB of RAM. Storage is used for caching the mirrored git repos and ensures speedup by a magnitude when doing a git pull instead of a full clone.
- Lines 17, 18, 21 and 22 show that we sync from an organization account on Gitee to a user account on GitHub. Depending on the EF Github setup, this might need to be adjusted. 5 Line 19 refers to the private key setup as secret in GitHub which is allowed to push changes to the repositories.
- In my testing, I also needed a token (line 11 and 20) to be allowed to create new repos over the API.
- In lines 2-7 we set it up to run on pushes to master as well as a cron job every 12 hours.
name: Mirror OH from gitee to github
on:
push:
branches:
- main
schedule:
- cron: '0 */12 * * *'
jobs:
repo-sync:
env:
dst_token: ${{ secrets.TOKEN }}
runs-on: self-hosted
timeout-minutes: 600
steps:
- uses: Yikun/hub-mirror-action@v1.2
with:
src: gitee/openharmony
dst: github/oh-test123
dst_key: ${{ secrets.SSH_PRIVATE_KEY }}
dst_token: ${{ secrets.TOKEN }}
src_account_type: org
dst_account_type: user
force_update: true
What is the current bug behavior?
N/A
What is the expected correct behavior?
Eclipse managed space in GitHub that mirrors OpenHarmony repositories. Repositories updated as frequently as technically possible.
Relevant logs and/or screenshots
N/A
Priority
-
Urgent -
High -
Medium -
Low
Severity
-
Blocker -
Major -
Normal -
Low
Impact
The development team has to work on the code, but this is severely hampered by connectivity issues with Gitee (delays, interruptions).