Skip to content

Commit

Permalink
fix build (#497)
Browse files Browse the repository at this point in the history
* fix build

* bump scala version
  • Loading branch information
juliano authored Oct 2, 2024
1 parent 8068670 commit 4a5ddd1
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ jobs:
strategy:
fail-fast: false
matrix:
scala: [ 3.3.3 ]
scala: [ 3.3.4 ]
module: [ sqltest, db, bigdata ]

steps:
- uses: actions/[email protected]
- name: Setup Java and Scala
uses: actions/setup-java@v4.2.1
uses: actions/setup-java@v4.3.0
with:
distribution: temurin
java-version: '17'
Expand All @@ -48,7 +48,7 @@ jobs:
steps:
- uses: actions/[email protected]
- name: Setup Java and Scala
uses: actions/setup-java@v4.2.1
uses: actions/setup-java@v4.3.0
with:
distribution: temurin
java-version: '17'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scala-steward.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: Scala Steward
steps:
- name: Scala Steward
uses: scala-steward-org/scala-steward-action@v2.66.0
uses: scala-steward-org/scala-steward-action@v2.69.0
with:
github-app-id: ${{ secrets.SCALA_STEWARD_GITHUB_APP_ID }}
github-app-installation-id: ${{ secrets.SCALA_STEWARD_GITHUB_APP_INSTALLATION_ID }}
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ lazy val basicSettings = Seq(
excludeDependencies ++= Seq(
ExclusionRule("org.scala-lang.modules", "scala-collection-compat_2.13")
),
scalaVersion := "3.3.3",
scalaVersion := "3.3.4",
// The -e option is the 'error' report of ScalaTest. We want it to only make a log
// of the failed tests once all tests are done, the regular -o log shows everything else.
// Test / testOptions ++= Seq(
Expand Down
2 changes: 1 addition & 1 deletion build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ fi

show_mem
echo "Tests completed. Shutting down"
time docker-compose down
time docker compose down
# for 2.12 publish coverage
if [[ $SCALA_VERSION == 2.12* ]]; then
echo "Coverage"
Expand Down
12 changes: 6 additions & 6 deletions build/m1/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@ In order to get this project to build on a Mac with an M1 or later chip, you wil
## Setup
To get started - be sure to setup the databases needed for the build/test process. Do so by executing the following:

`docker-compose -f docker-compose-m1.yml --rm setup`
`docker compose -f docker-compose-m1.yml --rm setup`

Any time you want to re-setup your databases (i.e. you run `docker-compose down`) - you will need to run that command pointed at the right YAML.
Any time you want to re-setup your databases (i.e. you run `docker compose down`) - you will need to run that command pointed at the right YAML.

## Compile and Test
To start the build and run tests, its often best to skip the codegen tests as they can sometimes cause phantom errors. To do this, execute the following:

`docker-compose -f docker-compose-m1.yml run sbt sbt -Dmodules=db test`
`docker compose -f docker-compose-m1.yml run sbt sbt -Dmodules=db test`

Drop the `-Dmodules=db` if you want to run ALL the tests (and grab an adult beverage while it runs - it'll be a while). Check out the `build.sbt` for a list of the
various modules you can build together or independently.

## Stop Your Services - Don't Down them!
Be nice to your M1 system - stop your services - don't down them. Running `docker-compose -f docker-compose-m1.yml down` will stop AND remove all your services. What this means is the next time you want to run your tests again - you better run setup again or your tests will fail due to missing databases!
Be nice to your M1 system - stop your services - don't down them. Running `docker compose -f docker-compose-m1.yml down` will stop AND remove all your services. What this means is the next time you want to run your tests again - you better run setup again or your tests will fail due to missing databases!

If you plan to have some rapid build/test cycles - run: `docker-compose -f docker-compose-m1.yml stop` to stop your services. It will preserve the volumes that were created when you ran setup. It'll save you a good amount of time.
If you plan to have some rapid build/test cycles - run: `docker compose -f docker-compose-m1.yml stop` to stop your services. It will preserve the volumes that were created when you ran setup. It'll save you a good amount of time.

## Build With a Specific Scala Version
By default the build executes with Scala 2.11. Not horrible - but if you want to take advantage of the improved compiler of a more recent 2.x verison of Scala you can specify that!
You can simply set the `quill.scala.version` when you start your build:

`docker-compose -f docker-compose-m1.yml run sbt sbt -Dquill.scala.version=2.13.6 -Dmodules=db test`
`docker compose -f docker-compose-m1.yml run sbt sbt -Dquill.scala.version=2.13.6 -Dmodules=db test`

Check out the [CONTRIBUTING](../../CONTRIBUTING.md) guide for more details. Good luck!
4 changes: 2 additions & 2 deletions build/setup_bigdata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

set -e

time docker-compose up -d cassandra orientdb
time docker compose up -d cassandra orientdb

# import setup functions
. build/setup_db_scripts.sh

# setup cassandra in docker
send_script cassandra $CASSANDRA_SCRIPT cassandra-schema.cql
send_script cassandra ./build/setup_db_scripts.sh setup_db_scripts.sh
time docker-compose exec -T cassandra bash -c ". setup_db_scripts.sh && setup_cassandra 127.0.0.1 cassandra-schema.cql"
time docker compose exec -T cassandra bash -c ". setup_db_scripts.sh && setup_cassandra 127.0.0.1 cassandra-schema.cql"

echo "Databases are ready!"
6 changes: 3 additions & 3 deletions build/setup_databases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
set -e

echo "### Bringing Down Any Docker Containers that May Be Running ###"
time docker-compose down --rmi all
time docker compose down --rmi all

echo "### Bringing Up sqlserver, oracle, postgres, mysql Images ###"
time docker-compose up -d sqlserver oracle postgres mysql
time docker compose up -d sqlserver oracle postgres mysql
echo "### DONE Bringing Up sqlserver and oracle Images ###"

echo "### Checking Docker Images"
Expand All @@ -28,7 +28,7 @@ echo "### Running Setup for sqlserver ###"
# setup sqlserver in docker
send_script sqlserver $SQL_SERVER_SCRIPT sqlserver-schema.sql
send_script sqlserver ./build/setup_db_scripts.sh setup_db_scripts.sh
time docker-compose exec -T sqlserver bash -c ". setup_db_scripts.sh && setup_sqlserver 127.0.0.1 sqlserver-schema.sql"
time docker compose exec -T sqlserver bash -c ". setup_db_scripts.sh && setup_sqlserver 127.0.0.1 sqlserver-schema.sql"

# Can't do absolute paths here so need to do relative
mkdir sqlline/
Expand Down
4 changes: 2 additions & 2 deletions build/setup_db_scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function setup_sqlserver() {

# Do a simple necat poll to make sure the oracle database is ready.
# All internal database creation and schema setup scripts are handled
# by the container and docker-compose steps.
# by the container and docker compose steps.

function setup_oracle() {
while ! nc -z $1 1521; do
Expand Down Expand Up @@ -158,7 +158,7 @@ function setup_oracle() {

function send_script() {
echo "Send Script Args: 1: $1 - 2 $2 - 3: $3"
docker cp $2 "$(docker-compose ps -q $1)":/$3
docker cp $2 "$(docker compose ps -q $1)":/$3
}

export -f setup_sqlite
Expand Down
4 changes: 2 additions & 2 deletions build/setup_mysql_postgres_databases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
set -e

echo "### Bringing Down Any Docker Containers that May Be Running ###"
time docker-compose down --rmi all
time docker compose down --rmi all

echo "### Bringing Up postgres, mysql Images ###"
time docker-compose up -d postgres mysql
time docker compose up -d postgres mysql

echo "### Checking Docker Images"
docker ps
Expand Down
2 changes: 1 addition & 1 deletion scripts/start_containers.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# From 'All In One' of Quill CONTRIBUTING.md
docker-compose down && docker-compose build && docker-compose run --rm --service-ports setup
docker compose down && docker compose build && docker compose run --rm --service-ports setup

# echo "Adding 50ms latency to protoquill_postgres_1"
# docker exec protoquill_postgres_1 tc qdisc add dev eth0 root netem delay 50ms
Expand Down

0 comments on commit 4a5ddd1

Please sign in to comment.