vania-janet/multiturn-rag-retrieval-data huggingface dataset:
FROM gcr.io/distroless/nodejs:16

COPY program.js /app/program.js

WORKDIR /app

CMD ["program.js"]

While the Ubuntu-based image is 147 MB, the image that is based on Alpine is 90 MB and the image that is based on distroless is 94 MB.





 Do not include sources and build tools to reduce image size 

In the previous Node.js based examples, a single source file is added to the container image. This example can use a single source file because no compilation was necessary. However, if a compilation is necessary, then use the necessary tools for the build only, but do not include them in the resulting image. For example, specify a Java application that uses Maven as example. A poorly coded Dockerfile looks similar to the following example,

FROM maven:3-jdk-11-openj9

WORKDIR /app
COPY . /app

RUN mvn package

EXPOSE 8080
ENTRYPOINT ["java", "-jar", "/app/target/java-application-1.0-SNAPSHOT-fat.jar"]

The resulting container image contains all the source code and all the intermediate files from Maven (such as its artifact cache, class files that are later packaged into a JAR file) as well as the Maven build tool. In addition, the Java Development Kit (JDK) is also included when a much smaller Java Runtime Environment (JRE) is required at run time. As a result, the image size is 466 MB.

To make the image smaller, use a feature called multi-stage builds. Each stage in a Docker build has its own base image and can run commands in its stage. At the end, a final image is built that copies in artifacts from previous stages. To build a container image from source code, a common pattern is to have two stages:



1. The builder stage that uses a base image that contains all the necessary tools to compile the source code into the binary for the runtime.
2.
Creative Commons Attribution 3.0 Generic 

The Program includes some or all of the following works licensed under the Creative Commons. The URL to the license is [https://creativecommons.org/licenses/by/3.0/legalcode](https://creativecommons.org/licenses/by/3.0/legalcode)

DOCS. [jq](http://archive.ubuntu.com/ubuntu/pool/universe/j/jq/jq_1.5+dfsg.orig.tar.gz), FONT AWESOME DOCUMENTATION [goconvey](https://fontawesome.com), SOUNDMANAGER.TS [xterm](http://registry.npmjs.org/xterm/-/xterm-3.14.5.tgz), H2DEMO [golang/net](https://github.com/golang/net/archive/13f9640d40b9cc418fb53703dfbd177679788ceb.zip), [SPDX-EXCEPTIONS](http://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz), SPDX STANDARD [spdx-expression-parse](https://github.com/spdx/spdx-spec), FIREWORKS.JPEG [Snappy](http://registry.npmjs.org/snappy/-/snappy-6.3.5.tgz), GO1.HTML [hashicorp/go.net](https://github.com/hashicorp/go.net/archive/afc3cb3a421746fc66dd55b09a270c750cf536ce.zip),GODOC.HTML [golang.org/x/tools] (Not Required), GOLANG-ORG.YAML [dnaeon/go-
For more information, see [Working with the IBM Cloud Object Storage event producer](https://cloud.ibm.com/docs/codeengine?topic=codeengine-eventing-cosevent-producer). 
 IBM® Event Streams for IBM Cloud® Subscribe to Kafka and Event Streams event producers from your application or job. For more information, see [Working with the Kafka event producer](https://cloud.ibm.com/docs/codeengine?topic=codeengine-working-kafkaevent-producer). 
 IBM Cloud Continuous Delivery Automate your app and job builds by using a toolchain. For more information about the setup, see [Integrating Code Engine workloads with Continuous Delivery](https://cloud.ibm.com/docs/codeengine?topic=codeengine-toolchain-ce). 







 Third-party integrations 

Code Engine is supported by the following third-party integrations. For issues in open source projects that are used by IBM Cloud, see the [IBM open source and third-party policy](https://www.ibm.com/support/pages/node/737271).



Table 2. Third-party integrations

 Integration Description 

 Lithops [Lithops](https://lithops-cloud.github.io/) is an open source framework that designed to massively scale your Python applications. See [Running jobs with Lithops framework](https://cloud.ibm.com/docs/codeengine?topic=codeengine-lithops). 
 Ray [Ray](https://www.ray.io/) is an open technology that enables data scientists and application developers to run their code in a distributed fashion. It also provides a lean and easy interface for distributed programming with many different libraries, best suited to perform machine learning and other intensive compute tasks. See [Ray on IBM Cloud Code Engine: Boost Your Serverless Compute](https://www.ibm.com/cloud/blog/ray-on-ibm-cloud-code-engine).
You can also create your own Tekton tasks and run the Code Risk Analyzer from those tasks.





 Using Code Risk Analyzer in DevSecOps 

You can use Code Risk Analyzer in [DevSecOps](https://cloud.ibm.com/docs/devsecops?topic=devsecops-devsecops_intro). The following table lists and describes the supported Code Risk Analyzer parameters for DevSecOps.

For more information about the dependent utility commands that are required by the pipeline image to run the bom-generate command, see [BOM requirements](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-cd-configure-cra-reposbom-requirements). If commands are missing, you can use the cra-custom-script-path parameter to reference a script to install those commands.



Table 8. DevSecOps Code Risk Analyzer-based parameters

 Name Type Description Required or optional 

 artifactory-dockerconfigjson SECRET The base64-encoded Docker config.json file that stores credential information for Artifactory. Optional 
 baseimage-auth-user text The credentials for the base image of the application Dockerfile that is required by the Code Risk Analyzer scan. Optional 
 baseimage-auth-email text The credentials for the base image of the application Dockerfile that is required by the Code Risk Analyzer scan. Optional 
 baseimage-auth-host text The credentials for the base image of the application Dockerfile that is required by the Code Risk Analyzer scan. Optional 
 baseimage-auth-password SECRET The credentials for the base image of the application Dockerfile that is required by the Code Risk Analyzer scan. Optional 
 cra-cveignore-path text The path to the cveignore file that is relative to the root of the application repo. The default file path is .cra/.cveignore. Optional 
 cra-custom-script-path text The path to a custom script that runs before Code Risk Analyzer scanning.
Examples 



  SDK working examples 

The SDK SHOULD contain a set of working examples for each service contained in the SDK. These working examples SHOULD provide a clear, concise example of how to use each operation within the service.

These examples SHOULD be relatively easy for users to execute, similar to test cases contained in the SDK.



  Guidelines for examples 

The SDK examples for a service SHOULD:



*  Include a clear, concise example of how to invoke each operation
*  Use realistic values for operation parameters and model properties which enhance the user's understanding of the operation
*  Use consistent parameter/property values across the various SDK languages (Go, Java, Node.js, and Python) as well as Curl; ideally, the parameter/property values used in the examples code are defined within "example" fields in the service's API definition



The examples can be used to provide the example code fragments displayed in the service's API Reference docs.
In this file, add the configuration to create resource instances by using the HashiCorp Configuration Language (HCL). For more information about using this configuration language, see the [Terraform documentation](https://www.terraform.io/docs/language/index.html).

The following example creates a Delivery Pipeline tool integration by using the ibm_cd_toolchain_tool_pipeline resource, where toolchain_id is a GUID that represents the toolchain in which to create the tool integration.

data "ibm_cd_toolchain" "cd_toolchain" {
toolchain_id = {toolchain_id}
}

resource "ibm_cd_toolchain_tool_pipeline" "cd_pipeline" {
toolchain_id = data.ibm_cd_toolchain.cd_toolchain.id
parameters {
name = "myPipeline"
}
}

For more information about tool integration resources, see the full list of supported tool integration resources in the [IBM Cloud Terraform Registry](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/cd_toolchain).
3. Initialize the Terraform CLI.

terraform init
4. Create a Terraform execution plan. This plan summarizes all of the actions that must run to create the tool integration.

terraform plan
5. Apply the Terraform execution plan. Terraform takes all of the required actions to create the tool integration.

terraform apply







 Updating a tool integration by using the console 

If you deferred the configuration of a tool integration when you created a toolchain, a Configure button is shown on its card. If you configured a tool integration when you created a toolchain, you can update the configuration settings by using the console.



1. From the IBM Cloud console, click the menu icon !
)](https://proxy.golang.org/google.golang.org/api/@v/v0.25.0.zip), FONT AWESOME [ANGularJS (Not Required)](https://github.com/angular/angular.js/releases/tag/v1.0.6), [ABOUTIVY.HTML (no copyright)](https://proxy.golang.org/golang.org/x/mobile/@v/v0.0.0-20190719004257-d2bd2a29d028.zip), [DIR.TMPL (no copyright)](https://proxy.golang.org/golang.org/x/tools/@v/v0.1.4.zip), [SPRITES (no copyright)](https://proxy.golang.org/golang.org/x/mobile/@v/v0.0.0-20190719004257-d2bd2a29d028.zip), GOPHER [gonum.org/v1/gonum (Not Required)](https://proxy.golang.org/gonum.org/v1/gonum/@v/v0.0.0-20190331200053-3d26580ed485.zip), GOPHER IMAGE BY RENEE FRENCH [Go (Copyright (c) Renee French)](https://golang.org/doc/gopher/fiveyears.jpg)
* PAGE CONTENT TMPL.GO [golang.org/x/net (Copyright 2017 The Go Authors)](https://github.com/golang/net/blob/e18ecbb051101a46fc263334b127c89bc7bff7ea/http2/h2demo/tmpl.go)
* FOOTER (Copyright © OpenJS Foundation.)
require github.com/rs/zerolog v1.19.0
2. Compress the source code to a compressed file that is called src.zip.

zip -r src.zip main.go go.mod

This example compresses main.go and go.mod files to src.zip.

If you are pre-compiling your code you might have to generate a go sum by running go mod tidy and adding it to your zip
3. If you want to pre-compile the code, use the compressed source code (src.zip) and compile it with the docker runtime image with the -compile command.



1. Compile the function to an executable file that is stored in a compressed format (main-bin.zip).

docker run -i openwhisk/action-golang-v1.19:nightly -compile main <src.zip >main-bin.zip

< and > are bash input output redirects and are part of the command.
2. Specify the compressed file (main-bin.zip) as the file for the action create command. The runtime kind must be specified when you use a compressed file; for example, --kind=go:1.19.



4. Create the action. The runtime must be specified with --kind=go:1.19.

With src.zip

ibmcloud fn action create module-action src.zip --kind=go:1.19

With pre-compiled code (main-bin.zip)

ibmcloud fn action create module-action main-bin.zip --kind=go:1.19

Alternatively if you want to pin the runtime image to a fixed runtime image version, use the --docker tag.

ibmcloud fn action create module-action src.zip --docker openwhisk/action-golang-v1.19:nightly

If you pin the action to a fixed runtime, the runtime cannot change or receive security fixes.









 Preparing Swift apps 

Swift files must be compiled before an action is run.
Creating your job from local source code with the CLI 

You can create your job directly from source code on your local workstation with the IBM Cloud® Code Engine CLI. Use the job create command to both build an image from your local source, and define the configuration for your job to reference this built image.

When you submit a build that pulls code from a local directory, your source code is packed into an archive file. Code Engine automatically uploads the image to an IBM Cloud® Container Registry namespace in your account, and then creates your job to reference this built image. Note that you can target only IBM Cloud Container Registry for your local builds. For this scenario, you need to provide only a name for the job and the path to the local source. For a complete listing of options, see the [ibmcloud ce job create](https://cloud.ibm.com/docs/codeengine?topic=codeengine-clicli-job-create) command.

For information about required permissions for accessing image registries, see [Setting up authorities for image registries](https://cloud.ibm.com/docs/codeengine?topic=codeengine-add-registryauthorities-registry).

You can choose to ignore certain file patterns from within your source code by using the .ceignore file, which behaves similarly to a .gitignore file. For example, entries for a .ceignore file for a node.js application might include node_modules and .npm. For more sample file patterns to ignore, see the [GitHub .gitignore repository](https://github.com/github/gitignore).

The IBM Cloud® Container Registry is required for this scenario.

Before you begin



* Set up your [Code Engine CLI](https://cloud.ibm.com/docs/codeengine?topic=codeengine-install-cli) environment.
* [Create and work with a project](https://cloud.ibm.com/docs/codeengine?topic=codeengine-manage-project).
* Your source must be in an accessible location on your local workstation.
If the environment variable is empty, Hello World is returned. For more information about the code that is used for this example, see [hello](https://github.com/IBM/CodeEngine/tree/main/hello).

If you have a container image that you want to use, you can replace the image reference in the next step with your own Docker repository, image name, and version.





 Step 2: Creating and deploying an application 



1. Create your application by using the [ibmcloud ce application create](https://cloud.ibm.com/docs/codeengine?topic=codeengine-clicli-application-create) command. In the following example, use myapp as the name of the application and specify icr.io/codeengine/hello as the image to reference.

ibmcloud ce application create --name myapp --image icr.io/codeengine/hello

Example output

Creating application 'myapp'...
[...]
Run 'C:Program FilesIBMCloudbinibmcloud.exe ce application get -n myapp' to check the application status.
OK
https://myapp.4svg40kna19.us-south.codeengine.appdomain.cloud
2. Run the [ibmcloud ce application get](https://cloud.ibm.com/docs/codeengine?topic=codeengine-clicli-application-get) command to display details about the application, including the URL for the myapp application.

ibmcloud ce application get -n myapp

Example output

Run 'ibmcloud ce application events -n myapp' to get the system events of the application instances.
Run 'ibmcloud ce application logs -f -n myapp' to follow the logs of the application instances.
OK

Name: myapp
ID: abcdefgh-abcd-abcd-abcd-1a2b3c4d5e6f
Project Name: myproject
Develop and deploy an application to a Virtual Machine 

This tutorial demonstrates how to set up a Continuous Delivery toolchain and deliver a simple application (app) to a Virtual Machine. You can set up source control, and then build, test, and deploy the code to different deployment stages.

By default, the toolchain uses a sample Maven-based Java Hello World app, but you can also bring your own app and link to it instead. This toolchain is configured with pipelines for continuous integration and continuous delivery with [Code Risk Analyzer (CRA)](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-cd-configure-cra-repos), source control, issue tracking, and online editing.

The application code is stored in the application source control repository (repo). The build and deploy scripts are stored in the pipeline source control repository. You can customize the build and deploy scripts to meet the development requirements for the app.

The toolchain in this tutorial implements the following best practices:



* Builds an application binary on every Git commit, and sets a tag based on build number, timestamp, and commit ID for traceability.
* Inserts the built binary into the deployment manifest automatically.
* Creates a Object Storage instance and Bucket to store the transient binary files that are built out-of-box. For advanced users, an existing Artifactory repo can be configured and integrated with the toolchain to support the versioning of build artifacts for traceability and compliance purposes.



The toolchain implements three pipelines to build and deploy app code to a Virtual Machine.



* Continuous Integration (CI) Pipeline: This pipeline is triggered when a change is merged to the master branch of the Application Source Code repo. The CI Pipeline runs the Unit Test, Code Coverage, and Static Scans on the Application Source Code. The CI Pipeline also generates the binary build artifact and uploads it to the Object Storage Bucket or Artifactory, as configured in the toolchain. And the CI Pipeline generates the metadata of the build artifacts and stores it in the Inventory repo.
* Continuous Deployment (CD) Pipeline: This pipeline is triggered by a successful CI Pipeline run.
For example, you might choose to let Code Engine handle the build of your local source while you evolve the development of your source for the job. Then, after the image is matured, you can update the job to reference the specific image that you want. You can repeat this process as needed.

When you run your updated job, the latest version of your referenced container image is used for the job run, unless a tag is specified for the image. If a tag is specified for the image, then the tagged image is used for the job run.



Looking for more code examples? Check out the [Samples for IBM Cloud Code Engine GitHub repo](https://github.com/IBM/CodeEngine).
The IBM Blockchain Platform Extension for VS Code (VS Code extension) referenced throughout the documentation is an open-source project which is no longer active, and therefore not officially supported by IBM. Refer to the [alternatives to the VS Code extension](https://github.com/IBM-Blockchain/blockchain-vscode-extension/issues/3159).

The IBM Blockchain Platform Developer Tooling includes guided tutorials to help you get started. The tutorials provide step-by-step instructions on how to develop and test your smart contract project, as well has how to deploy the smart contract to a network on IBM Cloud. You also can find sample smart contracts that are available for you to download.

To navigate to the tutorials from within VS Code, click the blockchain icon in the left navigation and then click the IBM Blockchain Platform icon at the upper right corner to view the extension homepage. On the homepage, you can find a link to the tutorials gallery and the sample smart contracts.

Zoom

![IBM Blockchain icon](https://cloud.ibm.com/docs-content/v1/content/c5288bed34c3820e3a5251d820ee91adcd2591a3/blockchain/images/vscode-tutorials.png)

Figure 4. Click on the IBM Blockchain icon in the upper right corner to navigate to the tutorials and sample code





 Step two: Create a smart contract project 

You can use the extension to create a new smart contract project in Visual Studio Code. The extension creates a basic smart contract that manages an example asset in the language of your choice. You can use the structure of the example as a starting point for developing your own business logic. The extension provides all the dependencies that are required to deploy your smart contract to an instance of Hyperledger Fabric.



1. Click the IBM Blockchain icon to open the IBM Blockchain tab. Click the overflow menu in the smart contracts pane and click Create New Project.
2. Select the smart contract type to generate.
The url to the license is https://creativecommons.org/licenses/by-sa/2.5/legalcode

CASES/MAP_TEST.GO [golang.org/x/text]
(https://proxy.golang.org/golang.org/x/text/@v/v0.3.6-0.20210227105805-e3aa4adf54f6.zip)

END OF CREATIVE COMMONS ATTRIBUTION SHARE ALIKE 2.5 GENERIC NON-IBM-LICENSE INFORMATION
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

CREATIVE COMMONS ATTRIBUTION SHARE ALIKE 3.0 GENERIC

The Program includes some or all of the following works licensed under
the Creative Commons.
The url to the license is https://creativecommons.org/licenses/by-sa/3.0/legalcode

CASES/MAP_TEST.GO [golang.org/x/text]
(https://proxy.golang.org/golang.org/x/text/@v/v0.3.6-0.20210227105805-e3aa4adf54f6.zip)

END OF CREATIVE COMMONS ATTRIBUTION SHARE ALIKE 3.0 GENERIC NON-IBM-LICENSE INFORMATION
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

GNU GENERAL PUBLIC LICENSE, VERSION 2

The Program includes some or all of the following licensed to you as
Separately Licensed Code under the GNU General Public License. For copies
of the source code for this software, send an email to <agupta@ca.ibm.com>
[ibm-watson](https://www.npmjs.com/package/ibm-watson) A Node.js client library to use the Watson APIs. 
 [iconv-lite](https://www.npmjs.com/package/iconv-lite) Pure JS character encoding conversion. 
 [jest](https://www.npmjs.com/package/jest) Delightful JavaScript Testing. 
 [jsdom](https://www.npmjs.com/package/jsdom) jsdom is a pure-JavaScript implementation of many web standards, notably the WHATWG DOM and HTML Standards. 
 [jsforce](https://www.npmjs.com/package/jsforce) Salesforce API Library for JavaScript applications. 
 [jsonwebtoken](https://www.npmjs.com/package/jsonwebtoken) An implementation of JSON Web Tokens. 
 [lodash](https://www.npmjs.com/package/lodash) The Lodash library that is exported as Node.js modules. 
 [log4js](https://www.npmjs.com/package/log4js) This package is a conversion of the log4js framework to work with node. 
 [marked](https://www.npmjs.com/package/marked) A full-featured markdown parser and compiler, which is written in JavaScript. Built for speed. 
 [merge](https://www.npmjs.com/package/merge) Merge multiple objects into one, optionally creating a new cloned object. 
 [moment](https://www.npmjs.com/package/moment) A lightweight JavaScript date library for parsing, validating, manipulating, and formatting dates. 
 [mongodb](https://www.npmjs.com/package/mongodb) The official MongoDB driver for Node.js.
string "" 
 issues_repo_url A template repository to clone compliance-issues for reference DevSecOps toolchain templates. string "" 
 inventory_repo_url A template repository to clone compliance-inventory for reference DevSecOps toolchain templates. string "" 







 Bring your own code 

The default experience for the DevSecOps toolchains is to use a sample app. This default can be updated to create an integration for your own application repository, which can be set to either clone an existing repository or use an existing repository. Set the following variables to clone or use an existing repository:



Table 5. Clone or use an existing repository

 Name Description Type Default 

 ci_app_repo_clone_from_branch Used when app_repo_clone_from_url is provided, the default branch that is used by the CI build, usually either main or master. string "" 
 ci_app_repo_clone_from_url Override the default sample app by providing your own sample app URL, which is cloned into the app repo. If the app repo exists, use clone_if_not_exists to leave the repo contents unchanged. string "" 
 ci_app_repo_clone_to_git_id By default absent, otherwise use custom server GUID, or other options for git_id field in the browser UI. string "" 
 ci_app_repo_clone_to_git_provider By default hostedgit, otherwise use githubconsolidated or gitlab. string "" 
 ci_app_repo_existing_branch Used when app_repo_existing_url is provided, the default branch that is used by the CI build, usually either main or master. string "" 
 ci_app_repo_existing_git_id By default absent, otherwise use custom server GUID, or other options for git_id field in the browser UI. string "" 
 ci_app_repo_existing_git_provider By default hostedgit, otherwise use githubconsolidated or gitlab. string ""