Deploy Your First Service¶
Choreo, an Internal Developer Platform (IDevP), simplifies the deployment, monitoring, and management of your cloud-native services, allowing you to focus on innovation and implementation.
Choreo allows you to easily deploy services you've created in your preferred programming language in just a few steps.
In this guide, you will:
- Use a pre-implemented service that has resources to maintain a book list.
- Build and deploy the service in Choreo using the
Nodejsbuildpack. It runs on port 8080.
- Test the service.
You will need a GitHub account with a repository that contains your service implementation. To follow this guide you can fork the Choreo sample book list service repository, which contains the sample for this guide.
If you are signing in to the Choreo Console for the first time, create an organization as follows:
- Go to https://console.choreo.dev/, and sign in using your Google, GitHub, or Microsoft account.
- Enter a unique organization name. For example,
- Click Create.
This creates the organization and opens the organization home page.
Learn the repository file structure¶
Let's familiarize ourselves with the key files in this sample application. The below table gives a brief overview of the important files in the sample book list service.
The following file paths are relative to the path
|Choreo-specific configuration that provides information about how Choreo exposes the service.
|OpenAPI contract of the service. This is required to publish our service as a managed API. This openapi.yaml file is referenced by the .choreo/endpoints.yaml.
Let's get started!
Step 1: Create a multi repository project¶
Follow the steps given below to create a multi repository project:
A multi repository project allows you to maintain multiple repositories and dedicate each of them to specific components or modules in your project.
- Go to https://console.choreo.dev/ and sign in. This opens the organization home page.
- On the organization home page, click + Create Project.
Enter a unique name and description for the project. You can enter the name and description given below:
Field Value Name Book List project Description My sample multi repository project
Select Multi Repository.
- Click Create.
Step 2: Create a service component¶
Let's create a service component by following these steps:
- In the landing page, under Connect Your Code, click on the Service card.
Enter a unique name and a description of the service. For this guide, let's enter the following values:
Field Value Name Book List Description Gets the book list
Select the GitHub tab.
If you have not already connected your GitHub repository to Choreo, click Authorize with GitHub, enter your GitHub credentials, and select the repository you created by forking Choreo sample book list service repositorys to install the Choreo GitHub App.
The Choreo GitHub App requires the following permissions:
- Read and write access to code and pull requests.
- Read access to issues and metadata.
You can revoke access if you do not want Choreo to have access to your GitHub account. However, write access is only used to send pull requests to a user repository. Choreo will not directly push any changes to a repository.
Enter the following information:
Field Description GitHub Account Your account GitHub Repository choreo-sample-book-list-service Branch main
Select the buildpack NodeJS.
Enter the following information.
Field Description NodeJS Project Directory /reading-list-service Language Version 20.x.x
Click Create. Once the component creation is complete, you will see the component overview page.
You have successfully created a Service component with the NodeJS buildpack. Now let's build and deploy the service.
Step 3: Build and deploy¶
Now that you have connected the source repository, and configured the endpoint details, it's time to build the service. Choreo will create a Docker image in the build process. You can then deploy the built Docker image and test the book list service.
Step 3.1: Build¶
To build the service, follow these steps:
- Select the component you created from the Components Listing.
- From the left navigation, go to the Build page and click Build.
- Select the latest commit and click Build.
Check the deployment progress by observing the console logs on the right of the page.
Building the service component may take a while. You can track the progress by observing the logs. Once the build process is complete, the build status changes to Success.
Step 3.2: Deploy¶
Next, to deploy this service, follow these steps:
- In the left navigation menu, click Deploy.
- On the Set Up card, click Configure & Deploy.
- Skip configuring the Environment Configurations and click Next.
- Skip adding a File Mount. Click Next.
Review the Endpoint Details and click Deploy.
Deploying the service component may take a while. You can track the progress by observing the logs. Once the deploying is complete, the build status changes to Active on the Development environment card.
Step 4: Test the service¶
To test the Book List service via the integrated OpenAPI Console in Choreo, follow the steps given below:
- In the Choreo Console left navigation menu, click Test and then click Console.
- In the OpenAPI Console that opens, select Development from the environment drop-down list.
- In the Endpoint list, select Books REST Endpoint.
- Expand the GET /books method and click Try it out.
- Click Execute.
- Check the Server Response section.
Similarly, you can expand and try out the other methods.