Oryx icon indicating copy to clipboard operation
Oryx copied to clipboard

Do not build Docker image every time CI is run

Open Reshmi-Sriram opened this issue 3 years ago • 5 comments

Feature Request

Copied from https://github.com/Azure/static-web-apps/issues/637 The full CI on GitHub takes roughly 1m 20s. And building docker image takes roughly 1m. Wouldn't be able to use pre built images? Or why building image is necessary every time?

Reshmi-Sriram avatar Nov 18 '21 09:11 Reshmi-Sriram

Hi @Reshmi-Sriram I'll be helping you with this. May you elaborate please. What is full CI on GitHub where could this be found? Oryx has one that takes much longer. I'm new to Oryx. Much appreciated.

william-msft avatar Nov 29 '21 02:11 william-msft

Hi @william-msft! This was a concern raised by a customer in the Static web Apps repo (link) I would like to ask @zalent to elaborate more on their ask. Hope this helps :)

Reshmi-Sriram avatar Nov 29 '21 02:11 Reshmi-Sriram

I don't know if this is something that Oryx can action on. To summarize:

  • Static Web Apps build runs in a container that is based on the Oryx image.
  • GitHub Actions uses a dockerfile as a mechanism to define the image to use for the action. There's nothing in the dockerfile that adds significant time.

When running the GitHub workflow, the dockerfile is built. As part of the build, roughly 45 seconds is spent pulling the SWA container image. The pull needs to occur whether we're building the dockerfile or not. The building of the image doesn't add much time to the time it takes to pull.

anthonychu avatar Dec 01 '21 18:12 anthonychu

We have a an Oryx workitem: 1457970 for our board. @anthonychu @Reshmi-Sriram is there are hard requirement on how much performance improvement is needed for speed?

william-msft avatar Jan 05 '22 20:01 william-msft

@william-msft No specific number. As long as we're using a container, there'll always be some overhead. A few things to investigate might include:

  • Can we remove anything from the oryx jamstack image? It's currently at about 2GB and this size directly affects the image pull time. I think we still have .NET Core 3.1 preinstalled. Discussed with @arroyc about removing it but not sure if that work was complete.
  • The image we use for the GitHub Action adds a layer on top of the oryx jamstack image. Looks like it's adding 90MB.
  • Investigate if GitHub is able to cache the image between workflow runs.
  • Reference a container image instead of using a Dockerfile in the GitHub Action. Not sure if this is possible, and the docker build adds a few seconds to the process.

anthonychu avatar Jan 17 '22 22:01 anthonychu

We're closing this issue due to its age. If this is still impacting you please open a new issue and simply link back to this one.

simonjj avatar Jan 11 '24 01:01 simonjj