Skip to content

Latest commit

 

History

History
80 lines (55 loc) · 3.79 KB

08-ce.md

File metadata and controls

80 lines (55 loc) · 3.79 KB

Use DevOps Build Pipelines to build the app native executable with GraalVM Community Edition

  1. If you haven't already mirrored your GitHub repo, mirror the GitHub repo DevOps Project >> Code Repositories >> Mirror repository.

  2. Each time you make a change to the GitHub repo, synchornize the changes in the OCI code repo DevOps Project >> Code Repositories >> github_graal-containers >> Synchronize now.

  3. Create a Build pipeline.

  4. From Build pipelines, add a Stage >> Managed Build to the build pipeline. Enter the following details:

    Stage name: Build the app native executable in the native-image container
    
    Description: Build the app native executable in the native-image container
    
    Build spec file path: devops-build-spec/build_spec_native_exec_ce.yaml
    

    For the Primary code repository, select the following values:

    Source: Connection type: OCI Code Repository
    
    From the list of repos, select the "github_graal-containers" repo.
    
    Select Branch: main
    
    Build source name: gvm
    

    Note: The Build source name is the name of the folder where the build service will check out the code from the repository.

    Leave all other values unchanged.

    Click Add.

  5. Test the build pipeline by clicking the Start manual run button.

  6. From DevOps Project >> Artifacts, click the Add artifact button. Enter the following details:

    Name: jibber-ni-gvmce22-jdk17
    
    Type: Container image repository
    
    Enter the fully qualified path to the image in Container Registry: (replace the values based on your region and tenancy namespace)
        <region-code>.ocir.io/<tenancy-namespace>/<repo-prefix>/jibber-ni-gvmce22-jdk17:${BUILDRUN_HASH}
    
        For example, 
        phx.ocir.io/your-tenancy-namespace/gvm/jibber-ni-gvmce22-jdk17:${BUILDRUN_HASH}
    
    Replace parameters used in this artifact:
        Yes, substitute placeholders
    

    Click Add.

  7. Go to your build pipeline and add a Stage >> Deliver artifacts after the Managed Build stage.

    Stage name: Push the runtime image containing the app native executable to OCIR
    
    Description: Push the runtime image containing the app native executable to OCIR
    
    Select artifacts: jibber-ni-gvmce22-jdk17
    
    Associate artifacts with build result:
        Destination DevOps artifact name: jibber-ni-gvmce22-jdk17
        Type: Docker image
        Build config/result artifact name: Build_output_image (should match the "name" of the "outputArtifacts" from your build_spec_native_exec_ce.yml file)
    

    Click Add.

  8. Go to OCIR and create an empty Private Repository named <repo-prefix>/jibber-ni-gvmce22-jdk17 e.g., gvm/jibber-ni-gvmce22-jdk17 in your compartment.

  9. Test the build pipeline again by clicking the Start manual run button. The runtime image should be pushed to the OCIR repo.

  10. To test the image on local,

    • Update the image and tag in the docker-compose.yml file for the jibber-ni-gvmce-jdk17 service.
    • As the OCIR repo is private, you will need to docker login to OCIR in your region. Note that OCIR stands for OCI Registry which is different from OCR (Oracle Container Registry).
    • If you haven't already logged in, run docker login <region-code>.ocir.io e.g., docker login phx.ocir.io in a terminal window. When prompted, enter your <tenancy-namespace>/<OCI-user-name> as the Username, and your <auth-token> as the Password.
    • Run docker compose up --remove-orphans to start the application on port 8083.
    • Run docker ps -a to check status of the running container.
    • Go to http://localhost:8083/jibber in a browser and you should see a nonsense verse.
    • Run docker compose stop in another terminal window to stop the application.

Back to Table of Contents