Skip to content

feat: move images from connector-runtime-docker repository#804

Merged
chillleader merged 4 commits intomainfrom
538-add-runtime-dockerfiles
Jun 30, 2023
Merged

feat: move images from connector-runtime-docker repository#804
chillleader merged 4 commits intomainfrom
538-add-runtime-dockerfiles

Conversation

@chillleader
Copy link
Member

Description

This PR incorporates Docker images that were previously managed in connector-runtime-docker repository. I have also adjusted a few things regarding project structure and what images we publish - please take a look below and I'm open to feedback! 🙂

Changes to project structure

  • New directory is created to manage the minimal viable version the connector runtime: /connector-runtime/connector-runtime-application. This is aligned with our modular approach, as we previously shipped the runtime in spring-boot-starter-camunda-connectors and in bundle versions. Spring Boot starter is not a standalone Java app, and bundle comes with OOTB connectors, so there was no middle ground (viable standalone runtime without any connectors).

  • In this PR, the minimal runtime is shipped in 2 forms: Maven module connector-runtime-application and Docker image camunda/connectors.

  • With this change, the structure of the /bundle/default-bundle module was slightly adjusted. It doesn't have its own @SpringBootApplication class anymore. Instead, it reuses the one defined in the new module, connector-runtime-application. Accordingly, the src directory of default-bundle is deleted.

Dockerfiles moved to this repo

  • /connector-runtime/connector-runtime-application/Dockerfile - base image for connector runtime, no connectors included. See DockerHub.
  • /connector-runtime/connector-runtime-application/example/Dockerfile - an example Dockerfile that illustrates how one can create a custom connectors bundle in a pure docker setup. ⚠️ With this PR, we stop publishing this image to Dockerhub, as it duplicates our default-bundle image. We continue to maintain it as an example for custom builds.

Build pipeline changes

  • Added a step to publish SNAPSHOT camunda/connectors base image from the new module in our DEPLOY.md pipeline
  • Added a step to publish versioned + latest tags in RELEASE.md pipeline
  • Added a step to lint the newly added dockerfile

Related issues

related to #538

@chillleader chillleader self-assigned this Jun 27, 2023
@chillleader chillleader added scope:runtime ci/cd Changes to our CI/CD pipelines docker Changes related to Docker images labels Jun 27, 2023
@chillleader chillleader marked this pull request as ready for review June 27, 2023 16:41
@chillleader chillleader requested a review from a team as a code owner June 27, 2023 16:41
fi

exec java "${JAVA_OPTS}" -cp '/opt/app/*' io.camunda.connector.bundle.ConnectorRuntimeApplication
unzip -l /opt/app/connector-runtime-application-0.21.0-SNAPSHOT-with-dependencies.jar | grep ConnectorRuntimeApplication
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this version (connector-runtime-application-0.21.0-SNAPSHOT-with-dependencies) be automatically updated by our maven plugin or will we have to manage it manually?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, this is a debug artifact - I removed this line

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sbuettner please take another look

@chillleader chillleader requested a review from sbuettner June 28, 2023 15:01
@sbuettner
Copy link
Contributor

@chillleader How would one launch the self-managed version with all connectorswithout building a docker image? Just search for the https://github.com/camunda/connectors-bundle/blob/538-add-runtime-dockerfiles/connector-runtime/connector-runtime-application/src/main/java/io/camunda/connector/runtime/app/ConnectorRuntimeApplication.java#L23 and execute that under the default-bundle project?

@chillleader
Copy link
Member Author

@sbuettner You can still use the docker image from the default-bundle module, as we continue to publish it on DockerHub. Sorry if it's confusing from the description. I meant that we stop publishing this image which was previously built from the example dockerfile.

@sbuettner
Copy link
Contributor

@chillleader Sorry, I wasnt clear enough. I meant just launching the whole bundle with all dependencies from the IDE.

@chillleader
Copy link
Member Author

Yeah then it's exactly like you described, navigate to the main class in default-bundle and run it

RUN chmod +x start.sh

# Copy Connector runtime from local build
COPY target/*-with-dependencies.jar /opt/app/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it even makes sense to simplify it to *.jar. WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This way the non-executable slim jar will also make it to the docker image.I think it makes sense to keep the classpath clean and only add the needed files

Copy link
Contributor

@igpetrov igpetrov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, several optional suggestions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd Changes to our CI/CD pipelines docker Changes related to Docker images scope:runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants