Skip to content

Commit

Permalink
1.7.0
Browse files Browse the repository at this point in the history
* Add support for teacher challenge page reconnects
* Support for log page feedback
* Add Float support
* Upgrade jars
  • Loading branch information
pambrose authored Dec 5, 2020
1 parent 048ddd8 commit 2e7588e
Show file tree
Hide file tree
Showing 100 changed files with 2,471 additions and 1,032 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ depends:
./gradlew dependencies

upgrade-wrapper:
./gradlew wrapper --gradle-version=6.6.1 --distribution-type=bin
./gradlew wrapper --gradle-version=6.7.1 --distribution-type=bin
25 changes: 21 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
id 'maven' // Required for jitpack.io to do a ./gradlew install
id 'org.jetbrains.kotlin.jvm' version '1.4.10'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.4.10'
id "com.github.ben-manes.versions" version '0.33.0'
id "com.github.ben-manes.versions" version '0.36.0'
id 'com.github.johnrengelman.shadow' version '6.1.0'
}

Expand All @@ -31,10 +31,15 @@ targetCompatibility = 1.8

description = 'ReadingBat Core'
group 'com.github.readingbat'
version '1.6.0'
version '1.7.0'

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"

implementation "org.jetbrains.kotlin:kotlin-reflect"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
implementation "org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable"

implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$serialization_version"

implementation "com.github.pambrose.common-utils:core-utils:$utils_version"
Expand Down Expand Up @@ -83,7 +88,9 @@ dependencies {
implementation "org.jetbrains.exposed:exposed-jdbc:$exposed_version"
implementation "org.jetbrains.exposed:exposed-jodatime:$exposed_version"

implementation "com.impossibl.pgjdbc-ng:pgjdbc-ng-all:$postgres_version"
implementation "com.impossibl.pgjdbc-ng:pgjdbc-ng-all:$pgjdbc_version"
implementation "org.postgresql:postgresql:$postgres_version"
implementation "com.google.cloud.sql:postgres-socket-factory:$cloud_version"

implementation "com.google.code.gson:gson:$gson_version"
implementation "com.google.guava:guava:$guava_version"
Expand All @@ -100,7 +107,13 @@ dependencies {

//testImplementation "org.seleniumhq.selenium:selenium-java:$selenium_version"
testImplementation "io.ktor:ktor-server-tests:$ktor_version"
testImplementation "org.amshove.kluent:kluent:$kluent_version"
testImplementation "io.ktor:ktor-server-test-host:$ktor_version"

testImplementation "io.kotest:kotest-runner-junit5:$kotest_version"
testImplementation "io.kotest:kotest-assertions-core:$kotest_version"
testImplementation "io.kotest:kotest-assertions-ktor:$kotest_version"
testImplementation "io.kotest:kotest-property:$kotest_version"

testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version"
}
Expand All @@ -120,6 +133,10 @@ task sourcesJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
}

//java {
// withSourcesJar()
//}

artifacts {
archives sourcesJar
}
Expand Down
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: "3.8"
services:
readingbat0:
image: "pambrose/readingbat:1.0.14"
restart: always
env_file: docker_env_vars
ports:
- "8080:8080"
readingbat1:
image: "pambrose/readingbat:1.0.14"
restart: always
env_file: docker_env_vars
ports:
- "8081:8080"
44 changes: 44 additions & 0 deletions docs/deployments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Deployment Configurations

## Common

```
AGENT_ENABLED=true
GITHUB_OAUTH=
SENDGRID_API_KEY=
XFORWARDED_ENABLED=true
FILTER_LOG=true
PAPERTRAIL_PORT=
IPGEOLOCATION_KEY=
```

## localhost
```
REDIS_URL=redis://user:[email protected]:6379
POSTGRES_URL=jdbc:pgsql://host.docker.internal:5432/readingbat
POSTGRES_USERNAME=postgres
POSTGRES_PASSWORD=docker
```

## Digital Ocean

```
REDIS_URL=rediss://default:[email protected]:port
POSTGRES_URL=jdbc:pgsql://readingbat-postgres.ondigitalocean.com:port/readingbat?ssl.mode=Require
POSTGRES_USERNAME=readingbat
POSTGRES_PASSWORD=
```

## Google Cloud Run

```
REDIS_URL=redis://ip_address:6379
DBMS_DRIVER_CLASSNAME=org.postgresql.Driver
POSTGRES_URL=jdbc:postgresql:///readingbat
POSTGRES_USERNAME=postgres
POSTGRES_PASSWORD=
CLOUD_SQL_CONNECTION_NAME=readingbat-1:us-west1:readingbat-postgres
```
9 changes: 8 additions & 1 deletion docs/notes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Notes

* [ktor Examples](https://github.com/ktorio/ktor-samples)
* [Scripting Examples](https://github.com/Kotlin/kotlin-script-examples)
* [Like/Dislike gifs](http://pngimg.com/imgs/symbols/like/)

## Running from *readingbat-core*
Expand Down Expand Up @@ -52,11 +53,17 @@ Setup:
* `mkdir -p $HOME/docker/volumes/postgres`
* `docker run --rm --name pg-docker -e POSTGRES_PASSWORD=docker -d -p 5432:5432 -v $HOME/docker/volumes/postgres:/var/lib/postgresql/data postgres`
* `psql -h localhost -U postgres -d postgres` use password: docker
* `psql "dbname=readingbat host=localhost port=5432 user=postgres password=docker"`

## Postgres Connection Pools
* https://www.thebookofjoel.com/kotlin-ktor-exposed-postgres
* https://github.com/brettwooldridge/HikariCP

## Exposed
* https://www.thebookofjoel.com/kotlin-ktor-exposed-postgres
* Upsert: https://github.com/JetBrains/Exposed/issues/167
* Upsert: https://medium.com/@OhadShai/first-steps-with-kotlin-exposed-cb361a9bf5ac
* Upsert: https://medium.com/@OhadShai/first-steps-with-kotlin-exposed-cb361a9bf5ac

## Google Cloud Postgres
* https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory
* ./bin/cloud_sql_proxy -instances=${ID}:${region}:readingbat-postgres=tcp:5432
23 changes: 13 additions & 10 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,28 @@ org.gradle.configureondemand=true
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
cloud_version=1.2.0
commons_version=1.9
css_version=1.0.0-pre.123-kotlin-1.4.10
exposed_version=0.27.1
coroutines_version=1.4.2
css_version=1.0.0-pre.129-kotlin-1.4.20
exposed_version=0.28.1
flexmark_version=0.62.2
github_api_version=1.116
github_api_version=1.117
gson_version=2.8.6
guava_version=29.0-jre
hikari_version=3.4.5
java_script_version=2.0.0
junit_version=5.7.0
kluent_version=1.61
ktor_version=1.4.1
kotest_version=4.3.1
ktor_version=1.4.2
logback_version=1.2.3
logging_version=2.0.3
postgres_version=0.8.4
pgjdbc_version=0.8.4
postgres_version=42.2.18
prometheus_version=0.9.0
proxy_version=1.8.6
proxy_version=1.8.7
redis_version=3.3.0
#selenium_version=4.0.0-alpha-6
serialization_version=1.0.0-RC2
sendgrid_version=4.6.6
utils_version=1.4.0
serialization_version=1.0.1
sendgrid_version=4.7.0
utils_version=1.5.0
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
9 changes: 9 additions & 0 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
jdk:
- openjdk11
#before_install:
# - ./custom_setup.sh
#install:
# - echo "Running a custom install command"
# - ./gradlew clean build -xtest publish publishToMavenLocal
#env:
# MYVAR: "custom environment variable"
15 changes: 15 additions & 0 deletions python/test_content/boolean_array_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
def flip(x):
for i in range(len(x)):
x[i] = not x[i]
return x


def main():
print(flip([True, True]))
print(flip([False]))
print(flip([True]))
print(flip([]))


if __name__ == '__main__':
main()
15 changes: 15 additions & 0 deletions python/test_content/boolean_list_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
def flip(x):
for i in range(len(x)):
x[i] = not x[i]
return x


def main():
print(flip([True, True]))
print(flip([False]))
print(flip([True]))
print(flip([]))


if __name__ == '__main__':
main()
15 changes: 15 additions & 0 deletions python/test_content/float_array_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
def inc1(x):
for i in range(len(x)):
x[i] = x[i] + 1.0
return x


def main():
print(inc1([3.4, 4.4]))
print(inc1([4.4]))
print(inc1([0.0]))
print(inc1([]))


if __name__ == '__main__':
main()
13 changes: 13 additions & 0 deletions python/test_content/float_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
def inc1(x):
return x + 1.0


def main():
print(inc1(3.4))
print(inc1(4.4))
print(inc1(5.4))
print(inc1(2.3))


if __name__ == '__main__':
main()
15 changes: 15 additions & 0 deletions python/test_content/int_array_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
def inc1(x):
for i in range(len(x)):
x[i] = x[i] + 1
return x


def main():
print(inc1([3, 4]))
print(inc1([4]))
print(inc1([0]))
print(inc1([]))


if __name__ == '__main__':
main()
15 changes: 15 additions & 0 deletions python/test_content/string_array_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
def flip(x):
for i in range(len(x)):
x[i] = x[i].upper()
return x


def main():
print(flip(["this", "is"]))
print(flip(["a"]))
print(flip(["test"]))
print(flip([]))


if __name__ == '__main__':
main()
Loading

0 comments on commit 2e7588e

Please sign in to comment.