현상: branch rule에 Require a pull request before merging를 추가하고

github action에서 쓰는 id에 force push를 허용해주고

github action에서 force push 해줬음에도 에러남
- name: Commit & Push changes
run: |
git add .
git commit -m "Update image tag for $STRIM_IMAGE_NAME"
git push origin HEAD:${{ github.ref }} --tags **--force**
해결
ruleset에 bypass에 deploy key 추가

deploy key를 생성(반드시 write 권한으로 생성해야 함)하고 github action에 아래 내용 추가. —force 는 없어도 됨
- name: Set up SSH key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
...
- name: Commit & Push changes
run: |
git add .
git commit -m "Update image tag for $STRIM_IMAGE_NAME"
**git remote set-url origin [email protected]:${{ github.repository }}.git # 추가된 부분**
git push origin HEAD:${{ github.ref }} --tags
참고
현상: sync fail
해결: sync option을 server-side 체크 후 다시 sync해보기, 없으면 replace로 체크한 후 다시 sync해보기 → 참고. 그래도 안되면 prune, force 체크
에러 내용
one or more objects failed to apply, reason: CustomResourceDefinition.apiextensions.k8s.io "runners.actions.summerwind.dev" is invalid: metadata.annotations: Too long: must have at most 262144 bytes,
현상: super linter에서 에러
해결: .flake8 파일에서 extend-ignore에서 E0213으로 되어있던걸 E213으로 고침
[flake8]
...
extend-ignore = ...,E0213 -> E213
현상: super linter에서 에러
해결: : Any = 를 이용하여 변수 선언 → 참고
적용 후 코드
if len(gpu_ids) > 1:
logger.info("Distributed Train!")
**train_callback: Any =** DistributedProgressTrainCallBack(output_path=metric_path)
else:
logger.info("Single Train!")
gpu_ids = [0]
train_callback = CustomTrainCallBack(output_path=metric_path)
현상: docker/build-push-action@v3을 이용해서 docker build를 할 때 발생한 에러
원인: context에서 선언하지 않은 변수를 사용함 changed_servers → changed_apps
사용 코드
- name: Build and Push
uses: docker/build-push-action@v3
with:
context: apps/${{ matrix.changed_apps }}
push: true
build-args: |
...
tags: |
${{ steps.generate-image-name.outputs.image_name }}:latest
${{ steps.generate-image-name.outputs.image_name }}:${{ env.HEAD }}
cache-from: type=registry,ref=${{ steps.generate-image-name.outputs.image_name }}:latest
cache-to: type=inline