Coder Social home page Coder Social logo

Comments (20)

sbose78 avatar sbose78 commented on July 19, 2024 1

Of course all of this is optional.

from build.

sbose78 avatar sbose78 commented on July 19, 2024 1

No worries, @otaviof is working on this, we'll discuss on a PR soon when it's up :)

from build.

sbose78 avatar sbose78 commented on July 19, 2024 1

Could we fork this into a separate issue so that this receives proper attention? :)
We need two issues

  • build from "jar" ( this one )
  • build from local source ( new one )

from build.

adambkaplan avatar adambkaplan commented on July 19, 2024 1

Meant to follow up on this - I propose the following terminology so we don't confuse this capability from OCP Binary build sources:

  1. "Remote artifact" - build source input from a file that is downloadable from a URL.
  2. "Local artifact" - use the local content to upload a file or directory.

As @zhangtbj and @sbose78 suggested, we should treat these separately.

from build.

sbose78 avatar sbose78 commented on July 19, 2024

@zhangtbj thoughts?

from build.

zhangtbj avatar zhangtbj commented on July 19, 2024

Hi @sbose78 ,

When you talking about the binary, do you mean the jar, war or tar of the source code, etc...?

Do you have this requirement before? I didn't see this type on the OpenShift console before.

I remember the Tekton can use it as a kind of resource, but I can not 100% make sure about that.

If Tekton doesn't support that, we should extract by ourselves at the beginning of the build.

At least, right now, we don't have this requirement. We can support that, but it is not on our 2Q delivery list now :)

from build.

zhangtbj avatar zhangtbj commented on July 19, 2024

I remember wrong. The kaniko support to use tar file:
https://github.com/GoogleContainerTools/kaniko#kaniko-build-contexts

from build.

sbose78 avatar sbose78 commented on July 19, 2024

By Binary I mean, that the application code is already built into a jar/war in case of Java.

All that remains is that it needs to be put into a deployable image.

from build.

zhangtbj avatar zhangtbj commented on July 19, 2024

Does that binary require any runtime support which inside of the deployable image?

I don't know if there is any build tool to support it for normal Dockerfile or CF(buildpacks) application.

But we tried the similar work before for Functions app, that for Java app, it comes from git repo first, but will be built as a jar file and inject it to a deployable image with the runtime.

I think jar/war is a special case just for Java. other language apps should base on tar file.

Is there any background/requirement detail behind that?

Or do you know what tool can support it?

from build.

sbose78 avatar sbose78 commented on July 19, 2024
  • A Jar/War should expect a runtime base image with Java
  • A golang binary should expect a lean base image ( like a RHEL UBI image )
  • A .Net binary should expect a runtime base image with the .Net framework binary in it.

from build.

zhangtbj avatar zhangtbj commented on July 19, 2024

Is there a unify solution/binary to solve these three different languages as a whole?

Can RedHat s2i binary do that? Or other tool?

from build.

sbose78 avatar sbose78 commented on July 19, 2024

Not really, the intention is to support a spec.output.base section where a user should be able to specify

  • output base image
  • location of the binary/binaries in the image in the previous stage
  • ..

There would be runtime image specific optional buildSteps which would effectively execute a equivalent of a multi-stage build.

from build.

zhangtbj avatar zhangtbj commented on July 19, 2024

For now, Dockerfile and buildpacks are high priority for us. I think if we have this kind of requirement. We can plan it after 2Q :)

from build.

zhangtbj avatar zhangtbj commented on July 19, 2024

👍 :)

from build.

rhuss avatar rhuss commented on July 19, 2024

For me, it's not so much important whether its an already compiled binary or the source code that it is compiled, it's about how the code (binary or source) is obtained. Typically in a CI/CD context you refer to the source via a Git or other SCM URL, which then is downloaded from there.

In contrast, in S2I a binary input (regardless of whether its an S2I, Docker or custom strategy) is uploaded from the local disc. Typically this is source (s2i/buildpack), or its a docker.tar container a Docker build context (e.g. for buildah/kaniko), but the important bit is that it's uploaded via an HTTP post.

For S2I the upload happens over a customer API endpoint ..../buildbinary to which that code is uploaded. This is not possible really for plain Kubernetes. There are several solutions to how this can be achieved here. One is to use an init-container to which you rsync/rcp the source before the application container does the build. I have some details for this mechanism with more details in some repo that I don't remember at the moment 😬 )

So I think you should rephrase your initial comment: It's really not about the binary aspect (i.e. some executable) but about a local upload (called "binary input" in S2I lingo)

from build.

rhuss avatar rhuss commented on July 19, 2024

Ah, here's a POC with Buildah and Upload via an init-container: https://github.com/rhuss/buildah-poc

from build.

rhuss avatar rhuss commented on July 19, 2024

The nice thing about using an init-container for the upload is that you have a nice synchronization point: The application container for the build will only start when the upload is finished (i.e. the init-container has been stopped). Of course, with Tekton you have probably many more possibilities to sync, this POC is just a poor men sync :)

from build.

zhangtbj avatar zhangtbj commented on July 19, 2024

Hi @rhuss ,
Glad to meet you in another repo! And very cool PoC :)

And I am glad that we are discussing a real requirement. (I tagged it as release 0.2.x for the next release function.

Actually, I summarized almost ALL communities local upload/build support, and list in the doc, please also review, all:
Local folder support for source-to-image
https://docs.google.com/document/d/1Mxnbp-5a1I0ik_Jajb99AFNMnW0kCbvmO5KE1YaIvo0/edit?usp=sharing

kubectl cp is the easiest way but I think it is not the best way :), because:

  • performance issue
  • kubectl community may be refined or deprecated in future to use new style (I heard that from a CVE issue/doc)

So I prefer the rsync way or an upload service to help us to upload the image for build container/pod.

I also investigated and summarized the oc binary build in another doc:
box-image

I think it is a good way, and I think we can use the similar upload service/controller in this build repo to support the local file upload and pass it to the existing buildstrategy/build.

Also cc @sbose78

from build.

zhangtbj avatar zhangtbj commented on July 19, 2024

aha, yes, agree.

It mixes the binary build which make us confusing. :)

Let us discuss the local(binary) build in other issue:
#59

from build.

qu1queee avatar qu1queee commented on July 19, 2024

Closing this issue, local source code support will be prototyped while developing https://github.com/shipwright-io/cli and we can use #59 for discussion. Remote artifacts already have a proposal in https://github.com/shipwright-io/build/blob/master/docs/proposals/remote-artifacts.md .

from build.

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.