Skip to content
Permalink
Browse files

Update docs to reflect adding Scala 2.13 support and dropping 2.11

  • Loading branch information...
sbrunk committed Aug 28, 2019
1 parent 7c0c369 commit 35a7763383807892da1edeab795f1b1238e8014b
@@ -1,6 +1,6 @@
# Dockerfile with support for creating images with kernels for multiple Scala versions.
# Expects ALMOND_VERSION and SCALA_VERSIONS to be set as build arg, like this:
# docker build --build-arg ALMOND_VERSION=0.3.1 --build-arg SCALA_VERSIONS="2.11.12 2.12.8" .
# docker build --build-arg ALMOND_VERSION=0.3.1 --build-arg SCALA_VERSIONS="2.12.9 2.13.0" .

# Set LOCAL_IVY=yes to have the contents of ivy-local copied into the image.
# Can be used to create an image with a locally built almond that isn't on maven central yet.
@@ -36,7 +36,7 @@ FROM coursier_base as local_ivy_no
FROM local_ivy_${LOCAL_IVY}
ARG ALMOND_VERSION
# Set to a single Scala version string or list of Scala versions separated by a space.
# i.e SCALA_VERSIONS="2.11.12 2.12.8"
# i.e SCALA_VERSIONS="2.12.9 2.13.0"
ARG SCALA_VERSIONS
USER $NB_UID
COPY scripts/install-kernels.sh .
@@ -138,11 +138,11 @@ $ sbt interpreter/test "~publishLocal"

Note that the sbt start up time is incurred each time you type `sbt` in your shell. Running it once, like `$ sbt`, then entering commands at the sbt prompt allows to avoid this.

Select a specific scala version, for example `2.11.12`, with `++2.11.12`. Example of use
Select a specific scala version, for example `2.12.9`, with `++2.12.9`. Example of use
```
$ sbt ++2.11.12 "~test:compile"
$ sbt ++2.12.9 "~test:compile"
$ sbt
> ++2.11.12
> ++2.12.9
> interpreter/test
```

@@ -8,9 +8,9 @@ for several Scala versions, or to test newer / former almond versions.
To install several version of the kernel side-by-side, just ensure the different installed versions
have different ids (required) and display names (recommended).

For example, let's install almond for the scala `2.12.7` version,
For example, let's install almond for the scala `2.13.0` version,
```bash
$ SCALA_VERSION=2.12.7 ALMOND_VERSION=@VERSION@
$ SCALA_VERSION=2.13.0 ALMOND_VERSION=@VERSION@
$ coursier bootstrap @EXTRA_COURSIER_ARGS@\
-r jitpack \
-i user -I user:sh.almond:scala-kernel-api_$SCALA_VERSION:$ALMOND_VERSION \
@@ -23,21 +23,21 @@ $ rm -f almond

This installs almond with the default kernel id, `scala`, and default display name, "Scala".

Now let's *also* install almond for scala `2.11.12`,
Now let's *also* install almond for scala `2.12.9`,
```bash
$ SCALA_VERSION=2.11.12 ALMOND_VERSION=@VERSION@
$ SCALA_VERSION=2.12.9 ALMOND_VERSION=@VERSION@
$ coursier bootstrap @EXTRA_COURSIER_ARGS@\
-r jitpack \
-i user -I user:sh.almond:scala-kernel-api_$SCALA_VERSION:$ALMOND_VERSION \
sh.almond:scala-kernel_$SCALA_VERSION:$ALMOND_VERSION \
--sources --default=true \
-o almond-scala-2.11
$ ./almond-scala-2.11 --install --id scala211 --display-name "Scala (2.11)"
$ rm -f almond-scala-2.11
-o almond-scala-2.12
$ ./almond-scala-2.12 --install --id scala212 --display-name "Scala (2.12)"
$ rm -f almond-scala-2.12
```

`--id scala211` ensures this kernel is installed along side the former, in a directory
with a different name.

`--display-name "Scala (2.11)"` ensures users can differentiate both kernels, with the latter
appearing in front-ends under the name "Scala (2.11)".
`--display-name "Scala (2.12)"` ensures users can differentiate both kernels, with the latter
appearing in front-ends under the name "Scala (2.12)".
@@ -9,7 +9,7 @@ picked from the cache of coursier. You may prefer to have the launcher embed all
so that nothing needs to be downloaded or picked from a cache upon launch. Passing
`--standalone` to the `coursier bootstrap` command generates such a launcher,
```bash
$ SCALA_VERSION=2.12.6 ALMOND_VERSION=0.1.7
$ SCALA_VERSION=@SCALA_VERSION@ ALMOND_VERSION=@VERSION@
$ coursier bootstrap --standalone \
-r jitpack \
-i user -I user:sh.almond:scala-kernel-api_$SCALA_VERSION:$ALMOND_VERSION \
@@ -4,8 +4,10 @@ title: Versions

Available Scala versions for each version of almond

Almond version | Scala 2.11 version | Scala 2.12 version
---------------|--------------------|-------------------
`0.1.0` to `0.1.8` | `2.11.12` | `2.12.6`
`0.1.9` - `0.1.12` | `2.11.12` | `2.12.6`, `2.12.7`
`0.1.13` - ... | `2.11.12` | `2.12.6`, `2.12.7`, `2.12.8`
Almond version | Scala 2.11 version | Scala 2.12 version | Scala 2.13 version
---------------|--------------------|--------------------|-------------------
`0.1.0` to `0.1.8` | `2.11.12` | `2.12.6` | -
`0.1.9` - `0.1.12` | `2.11.12` | `2.12.6`, `2.12.7` | -
`0.1.13` - `0.6.0` | `2.11.12` | `2.12.6`, `2.12.7`, `2.12.8` | -
`0.7.0` | - | `2.12.6`, `2.12.7`, `2.12.8` | `2.13.0`
`0.8.0` - ... | - | `2.12.6`, `2.12.7`, `2.12.8`, `2.12.9` | `2.13.0`
@@ -14,13 +14,15 @@ The only limitation is that the Scala version of Spark and the running Almond ke
kernel uses the same Scala version as your Spark cluster.
Spark 2.0.x - 2.3.x requires Scala 2.11. Spark 2.4.x supports both Scala 2.11 and 2.12.

Note that as of almond 0.7.0, almond only supports Scala 2.12 and therefore requires Spark 2.4.x for Scala 2.12.

For more information, see the [README](https://github.com/alexarchambault/ammonite-spark/blob/master/README.md) of ammonite-spark.

To use it, import the *almond-spark* dependency as well as Spark 2.x itself.

```scala
import $ivy.`org.apache.spark::spark-sql:2.4.0` // Or use any other 2.x version here
import $ivy.`sh.almond::almond-spark:@VERSION@`
import $ivy.`sh.almond::almond-spark:@VERSION@` // Not required since almond 0.7.0 (will be automatically added when importing spark)
```

Usually you want to disable logging in order to avoid polluting your cell outputs:

0 comments on commit 35a7763

Please sign in to comment.
You can’t perform that action at this time.