Instill Core is currently under rapid development. The project is built with
the microservice architecture. To develop each service
independently, we assign profiles
to each service in the
docker-compose-latest.yml
file in Core. This allows us to selectively enable services for various
purposes, e.g., debugging, development.
Services are associated with profiles through the profiles
attribute, which
takes an array of profile names. A service will be started only if one of its
profile names is activated. A service without profiles
will always be
started.
Core's profiles are defined as exclusion profiles, i.e., instead of launching a service and its dependencies, they'll launch all the services except the specified one. This optimizes the development experience, where a service is built locally in order to apply some changes in the source code while its dependencies tend to keep unchanged.
The following profiles are available on Core:
all
- start all servicesexclude-api-gateway
- start all the services butapi-gateway
exclude-artifact
- start all the services butartifact-backend
exclude-console
- start all the services butconsole
exclude-mgmt
- start all the services butmgmt-backend
exclude-model
- start all the services butmodel-backend
exclude-pipeline
- start all the services butpipeline-backend
Use one of the profile names to develop the corresponding service:
# In the `instill-core` repository foldermake latest PROFILE=all # or other profile name
The following guideline shows a specific example of how to develop the
pipeline-backend
service. For more details, you can read the service's
contribution
guidelines.
#Start dependent services for pipeline-backend
On the local machine, clone the
instill-core
repository in your workspace,
move to the repository folder, and launch all the dependent services:
# Clone the core repositorygit clone https://github.com/instill-ai/instill-core.gitcd instill-core# Use profile `exclude-pipeline` to launch all dependent services# for `pipeline-backend`make latest PROFILE=exclude-pipeline
#Run dev pipeline-backend
Clone the pipeline-backend
repository in your workspace and move to the repository folder:
git clone https://github.com/instill-ai/pipeline-backend.gitcd pipeline-backend
#Build & run the dev image
make build-devmake dev
Now, you have the Go project set up in the container, in which you can compile and run the binaries together with the integration test in each container shell.
#Start the pipeline-backend
server
docker exec -it pipeline-backend bashgo run ./cmd/migrationgo run ./cmd/initgo run ./cmd/main
#Start the Temporal worker
docker exec -it pipeline-backend bashgo run ./cmd/worker
#Run the integration tests
During local development, you can run the integration test to make sure your
latest pipeline-backend
works as intended:
docker exec -it pipeline-backend bashmake integration-test API_GATEWAY_URL=api-gateway:8080 DB_HOST=pg-sql
#Remove the dev container
make rm
#Shut down all dependent Core services
# In the `instill-core` repository foldermake down