Skip to content

Commit

Permalink
Switch registry to quay.io
Browse files Browse the repository at this point in the history
  • Loading branch information
HoKim98 committed Sep 8, 2022
1 parent b46af4c commit ed515d7
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 26 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Run tests
run: cargo test --all --workspace --verbose

build-and-push-image:
build-image:
if: ${{ github.ref == 'refs/heads/master' }}
needs:
- build-rust
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
# https://github.com/docker/metadata-action
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

Expand All @@ -82,7 +82,7 @@ jobs:
uses: docker/build-push-action@v3
with:
context: .
push: true
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

Expand All @@ -98,7 +98,7 @@ jobs:
# against the sigstore community Fulcio instance.
run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}

build-and-push-image-ipxe:
build-image-ipxe:
if: ${{ github.ref == 'refs/heads/master' }}
needs:
- build-rust
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
# https://github.com/docker/metadata-action
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ipxe

Expand All @@ -152,7 +152,7 @@ jobs:
uses: docker/build-push-action@v3
with:
context: ./templates/ipxe/
push: true
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

Expand All @@ -168,7 +168,7 @@ jobs:
# against the sigstore community Fulcio instance.
run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}

build-and-push-image-upgrade-kiss:
build-image-upgrade-kiss:
if: ${{ github.ref == 'refs/heads/master' }}
needs:
- build-rust
Expand Down Expand Up @@ -211,7 +211,7 @@ jobs:
# https://github.com/docker/metadata-action
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-upgrade-kiss

Expand All @@ -222,7 +222,7 @@ jobs:
uses: docker/build-push-action@v3
with:
context: ./templates/kiss/
push: true
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

Expand All @@ -241,9 +241,9 @@ jobs:
release:
if: ${{ github.ref == 'refs/heads/master' }}
needs:
- build-and-push-image
- build-and-push-image-ipxe
- build-and-push-image-upgrade-kiss
- build-image
- build-image-ipxe
- build-image-upgrade-kiss
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down
11 changes: 6 additions & 5 deletions kiss/api/src/ansible/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ impl AnsibleClient {
.or(job.spec.cluster.as_ref())
.map(String::as_str)
.unwrap_or("default");
let reset = self.force_reset || job
.status
.as_ref()
.and_then(|status| status.bind_cluster.as_ref())
!= job.spec.cluster.as_ref();
let reset = self.force_reset
|| job
.status
.as_ref()
.and_then(|status| status.bind_cluster.as_ref())
!= job.spec.cluster.as_ref();

// delete all previous cronjobs
{
Expand Down
5 changes: 2 additions & 3 deletions kiss/manager/src/current.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ impl Handler {
};
let job = Job {
spec: Some(JobSpec {
backoff_limit: Some(30),
template: PodTemplateSpec {
metadata: Some(ObjectMeta {
labels: metadata.labels.clone(),
Expand All @@ -190,9 +191,7 @@ impl Handler {
service_account: Some("kiss-controller".into()),
containers: vec![Container {
name: "kubectl".into(),
image: Some(
"ghcr.io/ulagbulag-village/netai-cloud-upgrade-kiss:master".into(),
),
image: Some("quay.io/kerryeon/netai-cloud-upgrade-kiss:latest".into()),
image_pull_policy: Some("Always".into()),
env: Some(vec![
EnvVar {
Expand Down
5 changes: 5 additions & 0 deletions kiss/manager/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ async fn sync_cluster(
match latest.cmp(&current) {
Ordering::Greater => {
info!("Found the newer version: {current} -> {latest}");

info!("Waiting for building images...");
// TODO: actively check for building images, or sync to workflows
tokio::time::sleep(Duration::from_secs(3600)).await;

current_handler.upgrade(&current, &latest).await
}
Ordering::Less => {
Expand Down
2 changes: 1 addition & 1 deletion templates/kiss/dnsmasq.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ spec:
type: RuntimeDefault
initContainers:
- name: init-tftpboot
image: ghcr.io/ulagbulag-village/netai-cloud-ipxe:master
image: quay.io/kerryeon/netai-cloud-ipxe:latest
command:
- bash
args:
Expand Down
2 changes: 1 addition & 1 deletion templates/kiss/kiss-assets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ spec:
type: RuntimeDefault
containers:
- name: assets
image: ghcr.io/ulagbulag-village/netai-cloud:master
image: quay.io/kerryeon/netai-cloud:latest
imagePullPolicy: Always
command:
- kiss-assets
Expand Down
2 changes: 1 addition & 1 deletion templates/kiss/kiss-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ spec:
serviceAccount: kiss-controller
containers:
- name: controller
image: ghcr.io/ulagbulag-village/netai-cloud:master
image: quay.io/kerryeon/netai-cloud:latest
imagePullPolicy: Always
command:
- kiss-controller
Expand Down
2 changes: 1 addition & 1 deletion templates/kiss/kiss-gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
serviceAccount: kiss-controller
containers:
- name: gateway
image: ghcr.io/ulagbulag-village/netai-cloud:master
image: quay.io/kerryeon/netai-cloud:latest
imagePullPolicy: Always
command:
- kiss-gateway
Expand Down
2 changes: 1 addition & 1 deletion templates/kiss/kiss-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
serviceAccount: kiss-controller
containers:
- name: manager
image: ghcr.io/ulagbulag-village/netai-cloud:master
image: quay.io/kerryeon/netai-cloud:latest
imagePullPolicy: Always
command:
- kiss-manager
Expand Down
2 changes: 1 addition & 1 deletion templates/kiss/kiss-monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
serviceAccount: kiss-controller
containers:
- name: monitor
image: ghcr.io/ulagbulag-village/netai-cloud:master
image: quay.io/kerryeon/netai-cloud:latest
imagePullPolicy: Always
command:
- kiss-monitor
Expand Down

0 comments on commit ed515d7

Please sign in to comment.