Skip to content
Merged
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file.

## [[7.3.0]](https://github.com/iExecBlockchainComputing/iexec-blockchain-adapter-api/releases/tag/v7.3.0) 2023-01-18

* Add endpoint to allow health checks.

## [[7.2.0]](https://github.com/iExecBlockchainComputing/iexec-blockchain-adapter-api/releases/tag/v7.2.0) 2023-01-09

* Increments jenkins-library up to version 2.2.3. Enable SonarCloud analyses on branches and pull requests.
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ To run properly, the iExec Blockchain Adapter API requires:
| IEXEC_BLOCKCHAIN_ADAPTER_API_WALLET_PATH | Path to the wallet of the server. | String | `src/main/resources/wallet.json` |
| IEXEC_BLOCKCHAIN_ADAPTER_API_WALLET_PASSWORD | Password to unlock the wallet of the server. | String | `whatever` |

## Health checks

A health endpoint (`/actuator/health`) is enabled by default and can be accessed on the **IEXEC_BLOCKCHAIN_ADAPTER_API_PORT**.
This endpoint allows to define health checks in an orchestrator or a [compose file](https://github.com/compose-spec/compose-spec/blob/master/spec.md#healthcheck).
No default strategy has been implemented in the [Dockerfile](docker/Dockerfile) at the moment.

## Running in development mode

`./gradlew docker`
Expand Down
11 changes: 7 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,17 @@ configurations {
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.awaitility:awaitility:4.0.1'

// Spring Doc
implementation 'org.springdoc:springdoc-openapi-ui:1.6.3'

implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'

// iexec
implementation "com.iexec.common:iexec-common:$iexecCommonVersion"
Expand All @@ -78,6 +77,9 @@ dependencies {

// integration tests
implementation project(':iexec-blockchain-adapter-api-library')

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.awaitility:awaitility:4.0.1'
}

springBoot {
Expand Down Expand Up @@ -161,6 +163,7 @@ ext.ociImageName = 'local/' + ['bash', '-c', 'basename $(git config --get remo
task buildImage(type: Exec) {
group 'Build'
description 'Builds an OCI image from a Dockerfile.'
dependsOn bootJar
commandLine("sh", "-c", "docker build -f docker/Dockerfile --build-arg jar=$jarPathForOCI -t $ociImageName:$gitShortCommit ."
+ " && docker tag $ociImageName:$gitShortCommit $ociImageName:dev")
}
4 changes: 4 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ ARG jar

RUN test -n "$jar"

RUN apt-get update \
&& apt-get install -y curl \
&& rm -rf /var/lib/apt/lists/*

COPY $jar app.jar

ENTRYPOINT [ "/bin/sh", "-c", "exec java -Djava.security.egd=file:/dev/./urandom -jar app.jar" ]
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=7.2.0
version=7.3.0
iexecCommonVersion=6.0.0

nexusUser
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected void configure(HttpSecurity http) throws Exception {
"/swagger-ui.html",
"/swagger-ui/**",
"/webjars/**").anonymous() // <--- END Anonymous swagger access
.antMatchers("/config/chain").permitAll()
.antMatchers("/actuator/health", "/config/chain").permitAll()
.anyRequest().authenticated()
.and()
.httpBasic();
Expand Down