Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 29 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions:
contents: write # release-drafter, auto-merge requirement
pull-requests: write # labeler, auto-merge requirement
jobs:
ci-2-12:
ci-2-13:
# run on 1) push, 2) external PRs, 3) softwaremill-ci PRs
# do not run on internal, non-steward PRs since those will be run by push to branch
if: |
Expand All @@ -17,7 +17,7 @@ jobs:
github.event.pull_request.user.login == 'softwaremill-ci'
runs-on: ubuntu-24.04
env:
scala: 2.12
scala: 2.13
steps:
- name: Check-out repository
id: repo-checkout
Expand All @@ -30,7 +30,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'
java-version: '17'

- name: Cache SBT
id: cache-sbt
Expand All @@ -44,9 +44,9 @@ jobs:

- name: Run tests
id: run-tests
run: SCALA_MAJOR_VERSION=${{ env.scala }} sbt "root/testOnly * -- -l org.elasticmq.rest.sqs.Only213"
run: SCALA_MAJOR_VERSION=${{ env.scala }} sbt root/test

ci-2-13:
ci-3-3:
# run on 1) push, 2) external PRs, 3) softwaremill-ci PRs
# do not run on internal, non-steward PRs since those will be run by push to branch
if: |
Expand All @@ -55,7 +55,7 @@ jobs:
github.event.pull_request.user.login == 'softwaremill-ci'
runs-on: ubuntu-24.04
env:
scala: 2.13
scala: 3.3
steps:
- name: Check-out repository
id: repo-checkout
Expand All @@ -68,7 +68,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'
java-version: '17'

- name: Cache SBT
id: cache-sbt
Expand All @@ -84,7 +84,7 @@ jobs:
id: run-tests
run: SCALA_MAJOR_VERSION=${{ env.scala }} sbt root/test

ci-3:
ci-3-9:
# run on 1) push, 2) external PRs, 3) softwaremill-ci PRs
# do not run on internal, non-steward PRs since those will be run by push to branch
if: |
Expand All @@ -93,7 +93,7 @@ jobs:
github.event.pull_request.user.login == 'softwaremill-ci'
runs-on: ubuntu-24.04
env:
scala: 3
scala: 3.9
steps:
- name: Check-out repository
id: repo-checkout
Expand All @@ -106,7 +106,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'
java-version: '17'

- name: Cache SBT
id: cache-sbt
Expand Down Expand Up @@ -165,7 +165,7 @@ jobs:
github.event.pull_request.user.login == 'softwaremill-ci'
runs-on: ubuntu-24.04
env:
scala: 2.13
scala: 3.9
steps:
- name: Check-out repository
id: repo-checkout
Expand All @@ -178,7 +178,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
java-version: '17'

- name: Set up Python
uses: actions/setup-python@v4
Expand Down Expand Up @@ -235,7 +235,7 @@ jobs:
github.event.pull_request.user.login == 'softwaremill-ci'
runs-on: ubuntu-24.04
env:
scala: 2.13
scala: 3.9
steps:
- name: Check-out repository
id: repo-checkout
Expand All @@ -248,7 +248,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
java-version: '17'

- name: Cache SBT
id: cache-sbt
Expand All @@ -268,8 +268,8 @@ jobs:

- name: Normalize JAR filenames
run: |
cp server/target/scala-2.13/elasticmq-server-assembly-*.jar server/target/elasticmq-server.jar
cp native-server/target/scala-2.13/elasticmq-native-server_2.13-*.jar native-server/target/elasticmq-native-server.jar
cp server/target/scala-*/elasticmq-server-assembly-*.jar server/target/elasticmq-server.jar
cp native-server/target/scala-*/elasticmq-native-server_*.jar native-server/target/elasticmq-native-server.jar

- name: Build JVM docker image
run: docker build -f server/Dockerfile -t softwaremill/elasticmq:local .
Expand All @@ -281,7 +281,7 @@ jobs:
run: docker build -f ui/Dockerfile -t softwaremill/elasticmq-ui:local ui/

publish-jar:
needs: [ci-2-12, ci-2-13, ci-3, ci-ui, ci-docker, ci-native-image-agent-config-verification]
needs: [ci-2-13, ci-3-3, ci-3-9, ci-ui, ci-docker, ci-native-image-agent-config-verification]
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
runs-on: ubuntu-24.04
steps:
Expand All @@ -295,7 +295,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'
java-version: '17'

- name: Cache sbt
uses: actions/cache@v4
Expand Down Expand Up @@ -339,22 +339,26 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Normalize assembly path
run: |
cp server/target/scala-*/elasticmq-server-assembly-*.jar "server/target/elasticmq-server-assembly-${{ env.VERSION }}.jar"

- name: Publish assembly jar
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: "server/target/scala-2.13/elasticmq-server-assembly-${{ env.VERSION }}.jar"
asset_path: "server/target/elasticmq-server-assembly-${{ env.VERSION }}.jar"
asset_name: "elasticmq-server-all-${{ env.VERSION }}.jar"
asset_content_type: application/java-archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-docker-build-jars:
needs: [ci-2-12, ci-2-13, ci-3, ci-ui, ci-docker, ci-native-image-agent-config-verification]
needs: [ci-2-13, ci-3-3, ci-3-9, ci-ui, ci-docker, ci-native-image-agent-config-verification]
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
runs-on: ubuntu-24.04
env:
scala: 2.13
scala: 3.9
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -366,7 +370,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
java-version: '17'

- name: Cache sbt
uses: actions/cache@v4
Expand All @@ -386,8 +390,8 @@ jobs:
- name: Prepare artifacts
run: |
mkdir dist
cp server/target/scala-2.13/elasticmq-server-assembly-*.jar dist/elasticmq-server.jar
cp native-server/target/scala-2.13/elasticmq-native-server_2.13-*.jar dist/elasticmq-native-server.jar
cp server/target/scala-*/elasticmq-server-assembly-*.jar dist/elasticmq-server.jar
cp native-server/target/scala-*/elasticmq-native-server_*.jar dist/elasticmq-native-server.jar

- name: Upload JARs
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -529,6 +533,6 @@ jobs:
auto-merge:
# only for PRs by softwaremill-ci
if: github.event.pull_request.user.login == 'softwaremill-ci'
needs: [ci-2-12, ci-2-13, ci-3, ci-ui, ci-docker, ci-native-image-agent-config-verification, label]
needs: [ci-2-13, ci-3-3, ci-3-9, ci-ui, ci-docker, ci-native-image-agent-config-verification, label]
uses: softwaremill/github-actions-workflows/.github/workflows/auto-merge.yml@main
secrets: inherit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ target
out
project/boot
/bin/
__pycache__/

.bsp
*.db
Expand Down
6 changes: 3 additions & 3 deletions .scala-steward.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
updates.ignore = [
{groupId = "com.amazonaws"},
{groupId = "software.amazon.awssdk"},
{groupId = "org.scala-lang", artifactId = "scala-compiler", version = "2.12."},
{groupId = "org.scala-lang", artifactId = "scala-compiler", version = "2.13."},
{groupId = "org.scala-lang", artifactId = "scala-compiler", version = "3."}
]
updates.pin = [
{groupId = "ch.qos.logback", artifactId = "logback-classic", version = "1.3."},
{groupId = "org.scala-lang", artifactId = "scala3-library", version = "3.3."},
{groupId = "org.scala-lang", artifactId = "scala3-library_sjs1", version = "3.3."}
{groupId = "org.scala-lang", artifactId = "scala3-library", version = "3.9."},
{groupId = "org.scala-lang", artifactId = "scala3-library_sjs1", version = "3.3."},
{groupId = "org.scala-lang", artifactId = "scala3-library_sjs1", version = "3.9."}
]
14 changes: 7 additions & 7 deletions CLAUDE.md → AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ elasticmq/
│ └── rest-sqs-testing-amazon-java-sdk/ # Integration tests with AWS SDKs
├── server/ # Stand-alone server entry point
│ └── docker/ # Docker config files
├── native-server/ # GraalVM native image build (Java 11+)
├── native-server/ # GraalVM native image build (Java 17)
├── integration-tests/
├── performance-tests/
├── examples/
Expand All @@ -34,7 +34,7 @@ elasticmq/

### Tech Stack

- **Language:** Scala (cross-compiled: 2.12, 2.13, 3.x; default 2.13)
- **Language:** Scala (cross-compiled: 3.9 LTS, 3.3 LTS, 2.13; default 3.9)
- **Actor system:** Apache Pekko
- **HTTP:** Pekko HTTP + spray-json
- **Persistence:** PureConfig (file), ScalikeJDBC + H2 (SQL)
Expand Down Expand Up @@ -67,7 +67,7 @@ sbt "server/assembly"
sbt "server/docker:publishLocal"

# Run server locally
java -jar server/target/scala-2.13/elasticmq-server-*.jar
java -jar server/target/scala-3.9.0/elasticmq-server-*.jar
```

### Running ElasticMQ
Expand Down Expand Up @@ -95,10 +95,10 @@ java -Dconfig.file=/path/to/elasticmq.conf -jar elasticmq-server.jar

### Scala Cross-Compilation

Set Scala version via environment variable before running sbt:
Set Scala version via environment variable before running sbt (`3.9` is the default):
```bash
SCALA_MAJOR_VERSION=2.12 sbt test
SCALA_MAJOR_VERSION=3 sbt test
SCALA_MAJOR_VERSION=3.3 sbt test
SCALA_MAJOR_VERSION=2.13 sbt test
```

## UI (Next.js)
Expand Down Expand Up @@ -266,4 +266,4 @@ aws --endpoint-url=http://localhost:9324 sqs list-queues

**npm issues:** `nvm use lts && rm -rf node_modules && npm install`

**sbt compile errors:** Check `SCALA_MAJOR_VERSION` env var and Java version (8+ for main, 11+ for native).
**sbt compile errors:** Check `SCALA_MAJOR_VERSION` env var and Java version (17+).
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Ideas, suggestions, problems, questions](https://img.shields.io/badge/Discourse-ask%20question-blue)](https://softwaremill.community/c/elasticmq)
[![ CI ](https://github.com/softwaremill/elasticmq/workflows/ElasticMQ%20tests/badge.svg)](https://github.com/softwaremill/elasticmq/actions?query=workflow%3A%22ElasticMQ+tests%22)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.elasticmq/elasticmq-rest-sqs_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.elasticmq/elasticmq-rest-sqs_2.12/)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.elasticmq/elasticmq-rest-sqs_3/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.elasticmq/elasticmq-rest-sqs_3/)

# tl;dr

Expand Down Expand Up @@ -269,7 +269,7 @@ in the main configuration file (as described in the previous section) in the `qu
# ElasticMQ dependencies in SBT

```scala
// Scala 2.13 and 2.12
// Scala 2.13 and 3 (published _3 artifacts are built with 3.9 LTS)
val elasticmqSqs = "org.elasticmq" %% "elasticmq-rest-sqs" % Version
```

Expand All @@ -289,7 +289,7 @@ Dependencies:
```xml
<dependency>
<groupId>org.elasticmq</groupId>
<artifactId>elasticmq-rest-sqs_2.12</artifactId>
<artifactId>elasticmq-rest-sqs_3</artifactId>
<version>${version}</version>
</dependency>
```
Expand Down Expand Up @@ -451,18 +451,17 @@ Do not forget to adjust the CPU and memory settings for the Docker process. It w
sbt "project nativeServer; clean; assembly; docker:publishLocal"
```

Generating GraalVM config files is a manual process currently. You need to run the fat-jar using the GraalVM VM (w/ native-image installed using `gu`), and then run the following commands to generate the configs:
Generating GraalVM config files is a manual process currently. You need to run the fat-jar using GraalVM for JDK 17 (with the native-image agent), and then run the following commands to generate the configs:

* `java -agentlib:native-image-agent=config-output-dir=... -jar elasticmq-server-assembly.jar`
* `java -agentlib:native-image-agent=config-merge-dir=... -Dconfig.file=test.conf -jar elasticmq-server-assembly.jar` (to additionally generate config needed to load custom elasticmq config)

These files should be placed in `native-server/src/main/resources/META-INF/native-image` and are automatically used by the native-image process.

In case of issues with running GraalVM with `native-image-agent` it's possible to execute above commands inside of docker container (the image is generated by the sbt command above).
`graalVmVersion` is defined in `build.sbt`:
In case of issues with running GraalVM with `native-image-agent` it's possible to execute above commands inside a Docker container:

```
docker run -it -v `pwd`:/opt/graalvm --entrypoint /bin/bash --rm ghcr.io-graalvm-graalvm-ce-native-image:java11-${graalVmVersion}
docker run -it -v `pwd`:/opt/graalvm --entrypoint /bin/bash --rm ghcr.io/graalvm/jdk-community:17
```

## Building multi-architecture image
Expand All @@ -471,7 +470,7 @@ Publishing Docker image for two different platforms: `amd64` and `arm64` is poss
Docker Buildx is included in Docker Desktop and Docker Linux packages when installed using the DEB or RPM packages. `build.sbt` has following setup:

* `dockerBuildxSettings` creates Docker Buildx instance
* Docker base image is `eclipse-temurin:11-jdk-noble` which supports multi-arch images
* Docker base image is `eclipse-temurin:17-jre-noble` which supports multi-arch images
* `dockerBuildCommand` is extended with operator `buildx`
* `dockerBuildOptions` has two additional parameters: `--platform=linux/arm64,linux/amd64` and `--push`

Expand Down Expand Up @@ -520,12 +519,12 @@ To check the coverage reports:
Although it's mostly only the core project that is relevant for coverage testing, each project's report can be found
in their target directory:

* core/target/scala-2.12/scoverage-report/index.html
* common-test/target/scala-2.12/scoverage-report/index.html
* rest/rest-sqs/target/scala-2.12/scoverage-report/index.html
* server/target/scala-2.12/scoverage-report/index.html
* core/target/scala-3.9.0/scoverage-report/index.html
* common-test/target/scala-3.9.0/scoverage-report/index.html
* rest/rest-sqs/target/scala-3.9.0/scoverage-report/index.html
* server/target/scala-3.9.0/scoverage-report/index.html

The aggregate report can be found at target/scala-2.12/scoverage-report/index.html
The aggregate report can be found at target/scala-3.9.0/scoverage-report/index.html

# UI

Expand Down
Loading
Loading