Skip to content

Commit e83f3e9

Browse files
committed
perf: update Parent Images w/docs
1 parent f7cf884 commit e83f3e9

File tree

7 files changed

+475
-36
lines changed

7 files changed

+475
-36
lines changed

.github/workflows/pi_build.yml

-28
Original file line numberDiff line numberDiff line change
@@ -112,31 +112,3 @@ jobs:
112112
build-args: |
113113
platform=linux/arm64
114114
label=dockerfile-path=https://github.com/refinery-${{ matrix.parent_image_type }}-parent-image/blob/${{ github.sha }}/Dockerfile
115-
116-
- name: Build & Push refinery-parent-images:sha-${{ matrix.parent_image_type }}
117-
uses: docker/build-push-action@v5
118-
with:
119-
context: .
120-
cache-from: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.sha }}-${{ matrix.parent_image_type }}-cache
121-
cache-to: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.sha }}-${{ matrix.parent_image_type }}-cache,mode=max,image-manifest=true
122-
platforms: linux/amd64
123-
file: Dockerfile
124-
tags: ${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.sha }}-${{ matrix.parent_image_type }}
125-
push: true
126-
build-args: |
127-
platform=linux/amd64
128-
label=dockerfile-path=https://github.com/refinery-${{ matrix.parent_image_type }}-parent-image/blob/${{ github.sha }}/Dockerfile
129-
130-
- name: Build & Push refinery-parent-images:sha-${{ matrix.parent_image_type }}-arm64
131-
uses: docker/build-push-action@v5
132-
with:
133-
context: .
134-
cache-from: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.sha }}-${{ matrix.parent_image_type }}-arm64-cache
135-
cache-to: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.sha }}-${{ matrix.parent_image_type }}-arm64-cache,mode=max,image-manifest=true
136-
platforms: linux/arm64
137-
file: Dockerfile
138-
tags: ${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.sha }}-${{ matrix.parent_image_type }}-arm64
139-
push: true
140-
build-args: |
141-
platform=linux/arm64
142-
label=dockerfile-path=https://github.com/refinery-${{ matrix.parent_image_type }}-parent-image/blob/${{ github.sha }}/Dockerfile

.github/workflows/pi_merge_parent_image.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ jobs:
240240
gh-delete-branch:
241241
name: 'GitHub: Delete Branch'
242242
needs: [pi-build]
243-
if: !failure()
243+
if: ${{ !failure() }}
244244
runs-on: ubuntu-latest
245245
steps:
246246
- name: Checkout repository
@@ -255,7 +255,7 @@ jobs:
255255
gh-delete-app-branches:
256256
name: 'GitHub: Delete Branch'
257257
needs: [pi-matrix, pi-update-app]
258-
if: !failure()
258+
if: ${{ !failure() }}
259259
runs-on: ubuntu-latest
260260
strategy:
261261
matrix:

.github/workflows/pi_merge_submodule.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
gh-delete-submodule-branches:
8686
name: 'GitHub: Delete Branch'
8787
needs: [pi-matrix, pi-update-submodule]
88-
if: !failure()
88+
if: ${{ !failure() }}
8989
runs-on: ubuntu-latest
9090
strategy:
9191
matrix:

README.md

+217
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ Scripts used for Kern AI CI/CD efforts.
2323
- [K8: Release](#k8-release)
2424
- [K8: Restart](#k8-restart)
2525
- [K8: Test](#k8-test)
26+
- [Parent Images: Build](#parent-images-build)
27+
- [Parent Images: Matrix](#parent-images-matrix)
28+
- [Parent Images: Submodules Merge](#parent-images-submodules-merge)
29+
- [Parent Images: Build](#parent-images-build)
30+
- [Parent Images: Release](#parent-images-release)
2631
- [OpenTofu: Release](#opentofu-release)
2732
- [OpenTofu: Generate Docs](#opentofu-generate-docs)
2833
- [OpenTofu: Plan/Apply](#opentofu-planapply)
@@ -585,6 +590,218 @@ Inputs:
585590

586591

587592

593+
### Parent Images: Build
594+
595+
Workflow file: `pi_build.yml`
596+
597+
Triggers:
598+
- pull_request_opened_synchronized
599+
600+
601+
602+
603+
604+
**Description:**
605+
606+
- builds & pushes refinery-parent-images:<branch>-<type> to registry.dev.kern.ai
607+
608+
609+
610+
**Jobs:**
611+
612+
- Configure Head Branch Name
613+
- `Configure branch name`
614+
615+
- pi-matrix
616+
617+
- Parent Images: Docker Build
618+
- `Set up Python`
619+
- `Install Dependencies`
620+
- `Compile Requirements`
621+
- `Build & Push refinery-parent-images:${{ needs.configure-branch-name.outputs.gh_head_ref }}-${{ matrix.parent_image_type }}`
622+
- `Build & Push refinery-parent-images:${{ needs.configure-branch-name.outputs.gh_head_ref }}-${{ matrix.parent_image_type }}-arm64`
623+
624+
625+
626+
627+
628+
### Parent Images: Matrix
629+
630+
Workflow file: `pi_matrix.yml`
631+
632+
Triggers:
633+
- workflow_call
634+
635+
Inputs:
636+
- repository
637+
- checkout_ref
638+
- parent_image_type
639+
640+
Outputs:
641+
- parent_image_type
642+
- include
643+
644+
**Description:**
645+
646+
- creates a [Strategy]() input for GitHub Action with the following structure:
647+
- {
648+
"parent_image_type": [
649+
"mini",
650+
"next"
651+
],
652+
"include": [
653+
{
654+
"parent_image_type": "mini",
655+
"app": "refinery-authorizer"
656+
},
657+
{
658+
"parent_image_type": "mini",
659+
"app": "refinery-gateway-proxy"
660+
},
661+
{
662+
"parent_image_type": "next",
663+
"app": "admin-dashboard"
664+
},
665+
{
666+
"parent_image_type": "next",
667+
"app": "refinery-ui"
668+
},
669+
{
670+
"parent_image_type": "next",
671+
"app": "cognition-ui"
672+
}
673+
]
674+
}
675+
676+
677+
678+
**Jobs:**
679+
680+
- Parent Images: Generate Matrix
681+
- `Generate Matrix`
682+
683+
684+
685+
686+
687+
### Parent Images: Submodules Merge
688+
689+
Workflow file: `pi_merge_submodule.yml`
690+
691+
Triggers:
692+
- pull_request_closed (dev)
693+
694+
695+
696+
697+
698+
**Description:**
699+
700+
- updates Parent Image repositories' submodule reference
701+
702+
703+
704+
**Jobs:**
705+
706+
- Configure Head Branch Name
707+
- `Configure branch name`
708+
709+
- pi-matrix
710+
711+
- Parent Images: Submodule
712+
- `Set up Python`
713+
- `Install Dependencies`
714+
- `Perform Edit/Git Operations`
715+
716+
- GitHub: Delete Branch
717+
- `Delete Branch`
718+
719+
720+
721+
722+
723+
### Parent Images: Build
724+
725+
Workflow file: `pi_merge_parent_image.yml`
726+
727+
Triggers:
728+
- pull_request_closed (dev)
729+
730+
731+
732+
733+
734+
**Description:**
735+
736+
- builds & pushes refinery-parent-images:dev-<type> to registry.dev.kern.ai
737+
- updates Application repositories' <type>-requirements.in and requirements.txt
738+
739+
740+
741+
**Jobs:**
742+
743+
- Configure Head Branch Name
744+
- `Configure branch name`
745+
746+
- pi-matrix
747+
748+
- Parent Images: Docker Build
749+
- `Set up Python`
750+
- `Install Dependencies`
751+
- `Compile Requirements`
752+
- `Build & Push refinery-parent-images:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}`
753+
- `Build & Push refinery-parent-images:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}-arm64`
754+
- `Build & Push refinery-parent-images:sha-${{ env.PARENT_IMAGE_TYPE }}`
755+
- `Build & Push refinery-parent-images:sha-${{ env.PARENT_IMAGE_TYPE }}-arm64`
756+
757+
- Parent Images: App
758+
- `Set up Python`
759+
- `Install Dependencies`
760+
- `Clone ${{ matrix.app }}`
761+
- `Compile Requirements (Python)`
762+
- `Compile Requirements (Next)`
763+
- `Perform Edit/Git Operations (Python)`
764+
- `Perform Edit/Git Operations (Next)`
765+
766+
- GitHub: Delete Branch
767+
- `Delete Branch`
768+
769+
- GitHub: Delete Branch
770+
- `Delete Branch`
771+
772+
773+
774+
775+
776+
### Parent Images: Release
777+
778+
Workflow file: `pi_release.yml`
779+
780+
Triggers:
781+
- prerelease
782+
783+
784+
785+
786+
787+
**Description:**
788+
789+
- builds & pushes refinery-parent-images:vX.X.X-<type> to Docker Hub
790+
- updates Application repositories' Dockerfiles to use the new parent image (updates Application repositories' open PRs)
791+
792+
793+
794+
**Jobs:**
795+
796+
- pi-matrix
797+
798+
- Parent Images: Dockerfile
799+
- `Perform Edit/Git Operations`
800+
801+
802+
803+
804+
588805
### OpenTofu: Release
589806

590807
Workflow file: `release_please.yml`

0 commit comments

Comments
 (0)