Skip to content

Commit ebfe240

Browse files
committed
Merge branch 'master' of github.com:scicloj/clojisr into lazyRDefs
2 parents 7118fc2 + 6cbcfe2 commit ebfe240

File tree

5 files changed

+65
-22
lines changed

5 files changed

+65
-22
lines changed

.devcontainer/Dockerfile

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
1-
FROM mcr.microsoft.com/devcontainers/java:21-bookworm
1+
FROM clojure:temurin-21-tools-deps-1.11.3.1456-jammy
2+
3+
ARG USERNAME=vscode
4+
ARG USER_UID=1000
5+
ARG USER_GID=$USER_UID
6+
7+
# Create the user
8+
RUN groupadd --gid $USER_GID $USERNAME \
9+
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
10+
#
11+
# [Optional] Add sudo support. Omit if you don't need to install software after connecting.
12+
&& apt-get update \
13+
&& apt-get install -y sudo \
14+
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
15+
&& chmod 0440 /etc/sudoers.d/$USERNAME
16+
17+
# ********************************************************
18+
# * Anything else you want to do like clean up goes here *
19+
# ********************************************************
20+
21+
# [Optional] Set the default user. Omit if you want to keep the default as root.
22+
USER $USERNAME
23+
SHELL ["/bin/bash", "-ec"]
24+
ENTRYPOINT ["bash"]
225

3-
RUN bash -c "bash < <(curl -s https://raw.githubusercontent.com/babashka/babashka/master/install)"
4-
RUN bash -c "bash < <(curl -s https://raw.githubusercontent.com/clojure-lsp/clojure-lsp/master/install)"
5-
RUN apt-get update && apt-get install -y rlwrap gfortran libblas-dev liblapack-dev libpng-dev libfontconfig1-dev libfreetype-dev gfortran libicu-dev cmake leiningen libxi6 libxtst6

.devcontainer/devcontainer.json

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,48 @@
11
{
2-
"name": "my Clojure app",
32
"build": {
43
"dockerfile": "Dockerfile"
4+
},
55

6-
},
7-
6+
"features": {
87

9-
"features": {
10-
"ghcr.io/devcontainers-contrib/features/clojure-asdf:2": {},
8+
"ghcr.io/devcontainers-contrib/features/apt-get-packages:1": {
9+
"packages": "rlwrap,r-base-dev"
10+
},
11+
"ghcr.io/rocker-org/devcontainer-features/quarto-cli:1": {},
1112
"ghcr.io/rocker-org/devcontainer-features/r-apt:0": {},
12-
"ghcr.io/devcontainers-contrib/features/leiningen-sdkman:2": {},
13-
"ghcr.io/rocker-org/devcontainer-features/quarto-cli:1": {}
14-
15-
16-
},
17-
"forwardPorts": ["12345","7777"],
13+
"ghcr.io/rocker-org/devcontainer-features/rstudio-server": {},
14+
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
15+
"ghcr.io/rocker-org/devcontainer-features/r-packages:1": {
16+
"packages": "nloptr,Rserve,ranger,randomForest,ggthemes,ggplot2,mice,dplyr",
17+
"additionalRepositories": "rforge= 'https://rforge.net'",
18+
"installSystemRequirements": true
19+
},
20+
"ghcr.io/wxw-matt/devcontainer-features/command_runner:latest": {
21+
"command1": "bash < <(curl -s https://raw.githubusercontent.com/clojure-lsp/clojure-lsp/master/install)",
22+
"command2": "bash < <(curl -s https://raw.githubusercontent.com/babashka/babashka/master/install)",
23+
"command3": "bash -c 'wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein -O /usr/local/bin/lein && chmod +x /usr/local/bin/lein'"
24+
}
25+
},
26+
"overrideFeatureInstallOrder": [
27+
"ghcr.io/rocker-org/devcontainer-features/r-apt",
28+
"ghcr.io/devcontainers-contrib/features/apt-get-packages",
29+
"ghcr.io/rocker-org/devcontainer-features/r-packages"
30+
],
31+
"forwardPorts": [12345],
32+
"portsAttributes": {
33+
"12345": {
34+
"label": "nrepl"
35+
}
36+
},
1837
"customizations": {
1938
"vscode": {
20-
"settings": {
21-
},
22-
"extensions":
23-
[
24-
"vscjava.vscode-java-pack",
39+
"extensions": [
2540
"betterthantomorrow.calva"
2641
]
2742
}
2843
},
2944

30-
"remoteUser": "vscode",
31-
"onCreateCommand": "Rscript -e 'pak::pkg_install(c(\"ranger\",\"randomForest\",\"ggthemes\",\"ggplot2\",\"mice\",\"dplyr\",\"url::https://rforge.net/Rserve/snapshot/Rserve_1.8-12.tar.gz\"))'"
45+
"postAttachCommand":
46+
{ "prepare": ["bash","-c", "-i", "source ./.devcontainer/setup.sh"]
47+
}
3248
}

.devcontainer/setup.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash -xe
2+
3+
clj -Sthreads 1 -P

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ All notable changes to this project will be documented in this file. This change
33

44
## unreleased
55
- added more operators `%/%`, `%%` ,`%in%`, `xor`
6+
- use devcontainer setup following template
7+
68
## [1.0.0]
79
- `require-r` creates namespace as `r.namespace`, also `namespace` as an alias
810
- dependencies update, TMD 7.029

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ The Dockerfile of the template adds as well python + libpython-clj for completen
9494

9595
So it has in a single place all dependencies and they do work together and no further setup is required.
9696

97+
There is as well a `devcontainer` setup in this GitHub [template](https://github.com/behrica/clojure-datascience-devcontainer). It provides as well an out-of-the box working environment and template for projects using ClojisR (and [libpythion-clj](https://github.com/clj-python/libpython-clj)
98+
9799
## Checking if it works
98100

99101
This should work for you (assuming you have the [clj tool](https://clojure.org/guides/getting_started)):

0 commit comments

Comments
 (0)