Git Product home page Git Product logo

Comments (3)

anoopcs9 avatar anoopcs9 commented on June 8, 2024

Possible lengthy approach using upload-artifact and download-artifact:

index cfc1ae5..8ce78b2 100644
--- a/.github/workflows/container-image.yml
+++ b/.github/workflows/container-image.yml
@@ -38,7 +38,15 @@ jobs:
     steps:
     - uses: actions/checkout@v2
     - name: Build the server image
-      run: make build-server
+      run: |
+        make build-server
+        podman save samba-container:latest > /tmp/server-image.tar
+    - name: Save image
+      uses: actions/upload-artifact@v3
+      with:
+        name: server-image-artifact
+        path: /tmp/server-image.tar
+        retention-days: 1
 
   build-ad-server:
     runs-on: ubuntu-latest
@@ -47,7 +55,15 @@ jobs:
     steps:
     - uses: actions/checkout@v2
     - name: Build the ad server image
-      run: make build-ad-server
+      run: |
+        make build-ad-server
+        podman save samba-ad-container:latest > /tmp/ad-server-image.tar
+    - name: Save image
+      uses: actions/upload-artifact@v3
+      with:
+        name: ad-server-image-artifact
+        path: /tmp/ad-server-image.tar
+        retention-days: 1
 
   build-client:
     runs-on: ubuntu-latest
@@ -62,9 +78,19 @@ jobs:
     #needs: build-server
     runs-on: ubuntu-latest
     steps:
-    - uses: actions/checkout@v2
+    - name: Retrieve image
+      uses: actions/download-artifact@v3
+      with:
+        name: server-image-artifact
+        path: /tmp
+    - name: Load image
+      run: podman load --input /tmp/server-image.tar
     - name: Test the server image
-      run: make test-server
+      uses: actions/checkout@v2
+      run: |
+        > .build-server
+        make test-server
+
 
   # Reminder: the nightly-server images consume nightly samba rpm builds
   # it is not *just* an image that gets built nightly
@@ -75,7 +101,15 @@ jobs:
     steps:
     - uses: actions/checkout@v2
     - name: Build the nightly server image
-      run: make build-nightly-server
+      run: |
+        make build-nightly-server
+        podman save samba-container:nightly > /tmp/nightly-server-image.tar
+    - name: Save image
+      uses: actions/upload-artifact@v3
+      with:
+        name: nightly-server-image-artifact
+        path: /tmp/nightly-server-image.tar
+        retention-days: 1
 
   build-nightly-ad-server:
     runs-on: ubuntu-latest
@@ -84,15 +118,32 @@ jobs:
     steps:
     - uses: actions/checkout@v2
     - name: Build the nightly ad server image
-      run: make build-nightly-ad-server
+      run: |
+        make build-nightly-ad-server
+        podman save samba-ad-container:nightly > /tmp/nightly-ad-server-image.tar
+    - name: Save image
+      uses: actions/upload-artifact@v3
+      with:
+        name: nightly-ad-server-image-artifact
+        path: /tmp/nightly-ad-server-image.tar
+        retention-days: 1
 
   test-nightly-server:
     #needs: build-nightly-server
     runs-on: ubuntu-latest
     steps:
-    - uses: actions/checkout@v2
+    - name: Retrieve image
+      uses: actions/download-artifact@v3
+      with:
+        name: nightly-server-image-artifact
+        path: /tmp
+    - name: Load image
+      run: podman load --input /tmp/nightly-server-image.tar
     - name: Test the nightly server image
-      run: make test-nightly-server
+      uses: actions/checkout@v2
+      run: |
+        > .build.nightly-server
+        make test-nightly-server
 
   test-ad-server-kubernetes:
     #runs-on: ubuntu-latest
@@ -103,12 +154,22 @@ jobs:
     - uses: nolar/setup-k3d-k3s@v1
     - name: get nodes
       run: kubectl get nodes
-    - name: build ad container
-      run: make CONTAINER_CMD=docker build-ad-server
+    - name: Retrieve image
+      uses: actions/download-artifact@v3
+      with:
+        name: ad-server-image-artifact
+        path: /tmp
+    - name: Load image
+      run: docker load --input /tmp/ad-server-image.tar
     - name: import ad server image
       run: k3d image import samba-ad-container:latest
-    - name: build file server container
-      run: make CONTAINER_CMD=docker build-server
+    - name: Retrieve image
+      uses: actions/download-artifact@v3
+      with:
+        name: server-image-artifact
+        path: /tmp
+    - name: Load image
+      run: docker load --input /tmp/server-image.tar
     - name: import file server image
       run: k3d image import samba-container:latest
     - name: run the ad-dc deployment test
@@ -125,12 +186,22 @@ jobs:
       - uses: nolar/setup-k3d-k3s@v1
       - name: get nodes
         run: kubectl get nodes
-      - name: build nighlty ad container
-        run: make CONTAINER_CMD=docker build-nightly-ad-server
-      - name: import nighlty ad server image
+      - name: Retrieve image
+        uses: actions/download-artifact@v3
+        with:
+          name: nightly-ad-server-image-artifact
+          path: /tmp
+      - name: Load image
+        run: docker load --input /tmp/nightly-ad-server-image.tar
+      - name: import nightly ad server image
         run: k3d image import samba-ad-container:nightly
-      - name: build nightly file server container
-        run: make CONTAINER_CMD=docker build-nightly-server
+      - name: Retrieve image
+        uses: actions/download-artifact@v3
+        with:
+          name: nightly-server-image-artifact
+          path: /tmp
+      - name: Load image
+        run: docker load --input /tmp/nightly-server-image.tar
       - name: import nightly file server image
         run: k3d image import samba-container:nightly
       - name: run the ad-dc deployment test

We'll have to measure the improvement(if any) by raising a draft PR and see if its worthy enough.

from samba-container.

phlogistonjohn avatar phlogistonjohn commented on June 8, 2024

We'll have to measure the improvement(if any) by raising a draft PR and see if its worthy enough.

Agreed, 100%.

Unfortunately, I'm skeptical that the round-trip of uploading and downloading the artifact will speed things up. But we should measure it first.

from samba-container.

anoopcs9 avatar anoopcs9 commented on June 8, 2024

We'll have to measure the improvement(if any) by raising a draft PR and see if its worthy enough.

Results from #76 suggest an improvement upto 20%.

from samba-container.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.