Skip to content

Commit ec9a4c5

Browse files
authored
Merge pull request #186 from r-devel/devel
Version 0.3 release
2 parents af7ea6e + 7650b12 commit ec9a4c5

36 files changed

+642
-322
lines changed

.devcontainer/devcontainer.json

Lines changed: 25 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,31 @@
1-
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2-
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
31
{
4-
"name": "R-Dev-Env",
5-
"image": "ghcr.io/r-devel/r-dev-env:main",
6-
"hostRequirements": {
7-
"cpus": 4
8-
},
9-
10-
"customizations": {
11-
"vscode": {
12-
"settings": {
13-
"r.lsp.diagnostics": false,
14-
"r.plot.useHttpgd": true,
15-
"r.rpath.linux": "/usr/bin/R",
16-
"r.rterm.linux": "/usr/bin/R",
17-
"terminal.integrated.sendKeybindingsToShell": true,
18-
"svn.multipleFolders.enabled": true,
2+
"name": "R-Dev-Env",
3+
"image": "ghcr.io/r-devel/r-dev-env:main",
4+
"hostRequirements": {
5+
"cpus": 4
6+
},
7+
"customizations": {
8+
"vscode": {
9+
"settings": {
10+
"r.lsp.diagnostics": false,
11+
"r.plot.useHttpgd": true,
12+
"r.rpath.linux": "/usr/bin/R",
13+
"r.rterm.linux": "/usr/bin/R",
14+
"terminal.integrated.sendKeybindingsToShell": true,
15+
"svn.multipleFolders.enabled": true,
1916
"workbench.editorAssociations": {
2017
"*.md": "vscode.markdown.preview.editor"
2118
},
2219
"workbench.welcomePage.walkthroughs.openOnInstall": false
23-
},
24-
"extensions": [
25-
"REditorSupport.r",
26-
"mads-hartmann.bash-ide-vscode",
27-
"johnstoncode.svn-scm",
28-
"ms-vscode.cpptools",
29-
"MS-vsliveshare.vsliveshare"
30-
]
31-
}
32-
33-
},
34-
"postCreateCommand":"cat /workspaces/r-dev-env/scripts/welcome_msg.sh >> ~/.bashrc && cat /workspaces/r-dev-env/scripts/set_build_r.sh >> ~/.bashrc && bash /workspaces/r-dev-env/scripts/localscript.sh"
35-
// Features to add to the dev container. More info: https://containers.dev/features.
36-
// "features": {},
37-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
38-
// "forwardPorts": [],
39-
// Use 'postCreateCommand' to run commands after the container is created.
40-
// "postCreateCommand": "gcc -v",
41-
// Configure tool-specific properties.
42-
// "customizations": {},
43-
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
44-
// "remoteUser": "root"
20+
},
21+
"extensions": [
22+
"REditorSupport.r",
23+
"mads-hartmann.bash-ide-vscode",
24+
"johnstoncode.svn-scm",
25+
"ms-vscode.cpptools",
26+
"MS-vsliveshare.vsliveshare"
27+
]
28+
}
29+
},
30+
"postCreateCommand": "chown -R vscode:vscode /workspaces/r-dev-env && sh /workspaces/r-dev-env/scripts/localscript.sh"
4531
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
name: Build and publish Gitpod Docker image
7+
8+
on:
9+
workflow_dispatch:
10+
pull_request:
11+
branches: ["main","devel"]
12+
types: [closed]
13+
paths:
14+
- '.github/workflows/build-gitpod-image.yml'
15+
- '.gitpod.Dockerfile'
16+
- '.gitpod.yml'
17+
- 'reinstall-cmake.sh'
18+
- 'VERSION'
19+
20+
21+
env:
22+
REGISTRY: ghcr.io
23+
IMAGE_NAME: ${{ github.repository }}
24+
25+
jobs:
26+
build-and-push-image:
27+
if: ${{github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true}}
28+
runs-on: ubuntu-latest
29+
permissions:
30+
contents: read
31+
packages: write
32+
33+
steps:
34+
- name: Checkout repository
35+
uses: actions/checkout@v4
36+
37+
- name: Extract version number
38+
run: |
39+
VER=$(cat VERSION)
40+
echo "VERSION=$VER" >> $GITHUB_ENV
41+
42+
- name: Log in to the Container registry
43+
uses: docker/login-action@v3
44+
with:
45+
registry: ${{ env.REGISTRY }}
46+
username: ${{ github.actor }}
47+
password: ${{ secrets.GITHUB_TOKEN }}
48+
49+
- name: Extract metadata (tags, labels) for Docker
50+
id: meta
51+
uses: docker/metadata-action@v5
52+
with:
53+
images: ${{ env.REGISTRY }}/${{ github.repository }}
54+
tags: |
55+
type=ref,event=branch
56+
type=ref,event=pr
57+
type=semver,pattern={{ env.VERSION }}
58+
type=sha
59+
60+
- name: Build and push Docker image
61+
uses: docker/build-push-action@v5
62+
with:
63+
context: .
64+
file: .gitpod.Dockerfile
65+
push: true
66+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:gitpod.${{ github.ref_name }}
67+
build-args: |
68+
CONTAINER_VERSION=${{ env.VERSION }}
69+
labels: ${{ steps.meta.outputs.labels }}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Optimize Docs Images
2+
3+
on:
4+
pull_request:
5+
branches: ["main","devel"]
6+
types: [closed]
7+
paths:
8+
- 'docs/assets/**'
9+
10+
jobs:
11+
optimize-images:
12+
if: ${{github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true}}
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v2
18+
19+
- name: Setup R
20+
uses: r-lib/actions/setup-r@v2
21+
22+
- name: Install system dependencies
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get install -y libmagick++-dev libcurl4-openssl-dev
26+
27+
- name: Install R packages
28+
run: |
29+
R -e 'install.packages(c("magick"), repos = "https://cloud.r-project.org/")'
30+
31+
- name: Optimize images
32+
run: |
33+
Rscript ./scripts/optimize.R
34+
35+
- name: Commit and push optimized images
36+
if: github.ref == 'refs/heads/devel' && github.event_name == 'push'
37+
run: |
38+
git config --global user.name "github-actions[bot]"
39+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
40+
git add docs/assets
41+
git commit -m 'Optimize docs images'
42+
git push
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitpod.Dockerfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM gitpod/workspace-full:latest
2+
3+
USER root
4+
5+
ARG REINSTALL_CMAKE_VERSION_FROM_SOURCE="none"
6+
7+
# Optionally install the cmake for vcpkg
8+
COPY ./reinstall-cmake.sh /tmp/
9+
10+
RUN if [ "${REINSTALL_CMAKE_VERSION_FROM_SOURCE}" != "none" ]; then \
11+
chmod +x /tmp/reinstall-cmake.sh && /tmp/reinstall-cmake.sh ${REINSTALL_CMAKE_VERSION_FROM_SOURCE}; \
12+
fi \
13+
&& rm -f /tmp/reinstall-cmake.sh
14+
15+
RUN sed -i.bak "/^#.*deb-src.*universe$/s/^# //g" /etc/apt/sources.list \
16+
&& echo "deb https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/" >> /etc/apt/sources.list \
17+
&& wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc \
18+
&& apt update \
19+
&& apt -y install subversion \
20+
&& apt -y build-dep r-base-dev \
21+
&& apt -y install r-base-dev \
22+
&& apt -y install valgrind \
23+
&& Rscript -e "install.packages('languageserver', repos='https://cran.rstudio.com')" \
24+
&& Rscript -e "install.packages('httpgd', repos='https://cran.rstudio.com')"
25+
26+
RUN apt install -y shellcheck
27+
RUN apt install -y ccache
28+
RUN apt install -y rsync
29+
#RUN /usr/sbin/update-ccache-symlinks
30+
#RUN echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a /home/vscode/.bashrc
31+
32+
33+
ARG CONTAINER_VERSION
34+
ENV CONTAINER_VERSION ${CONTAINER_VERSION}

.gitpod.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
image: ghcr.io/r-devel/r-dev-env:gitpod.devel
2+
3+
tasks:
4+
- name: Initial Setup for R-dev-env Gitpod Workspace
5+
before: |
6+
bash /workspace/r-dev-env/scripts/localscript.sh
7+
source ~/.bashrc
8+
9+
10+
vscode:
11+
extensions:
12+
- REditorSupport.r
13+
- johnstoncode.svn-scm

CITATION.cff

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
cff-version: 1.2.0
2-
message: "If you use this software, please cite it as below."
3-
authors:
4-
- family-names: Shirdhankar
5-
given-names: Atharva
6-
- family-names: Turner
7-
given-names: Heather
8-
- family-names: Tripp
9-
given-names: James
10-
- family-name: Emsley
11-
given-names: Iain
12-
title: "R Development Container"
13-
version: 0.2.0
14-
doi:
15-
date-released: 28-06-2024
1+
cff-version: 1.2.0
2+
message: "If you use this software, please cite it as below."
3+
authors:
4+
- family-names: Shirdhankar
5+
given-names: Atharva
6+
- family-names: Turner
7+
given-names: Heather
8+
- family-names: Tripp
9+
given-names: James
10+
- family-name: Emsley
11+
given-names: Iain
12+
- family-names: Crespo
13+
given-names: Lorena
14+
- family-names: Campitelli
15+
given-names: Elio
16+
17+
title: "R Development Container"
18+
version: 0.3.0
19+
doi:
20+
date-released: 04-09-2024

Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ RUN apt install -y ccache
2626
#RUN echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a /home/vscode/.bashrc
2727

2828

29-
ENV BUILDDIR="/workspaces/r-dev-env/build/r-devel"
30-
ENV TOP_SRCDIR="/workspaces/r-dev-env/svn/r-devel"
31-
ENV PATCHDIR='/workspaces/r-dev-env/patches'
29+
3230
ARG CONTAINER_VERSION
3331
ENV CONTAINER_VERSION ${CONTAINER_VERSION}

INDEX.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,27 @@
33
If you haven't seen them yet, you can find the
44
[R Dev Container Docs](https://contributor.r-project.org/r-dev-env/) online.
55

6+
This index links to underlying markdown files for key sections of the docs, so you can preview them right here in VS Code.
7+
8+
## Working with the container
9+
10+
The links below give more information on using the container via GitHub Codespaces or Gitpod Workspaces.
11+
Take a moment to review how to stop and restart your container, so you can continue your work.
12+
If you are collaborating with others, you may want to use Live Share so that you can share the same workspace.
13+
14+
### Github Codespace
15+
16+
- [Stopping and Restarting Codespace](docs/container_setup/github_codespace/codespacestartstop.md)
17+
- [Collaborating with Live Share](docs/container_setup/github_codespace/live_share.md)
18+
19+
### Gitpod Workspace
20+
21+
- [Stopping and Restarting Codespace](docs/container_setup/gitpod_workspace/workspacestop_and_restart.md)
22+
- [Collaborating with Live Share](docs/container_setup/gitpod_workspace/live_share.md)
23+
624
## Tutorials
725

8-
You can also preview the tutorials right here in VSCode, making them easier to work through.
26+
Learn how to use the container with these mini tutorials.
927
If you have used R in VSCode before, you can skip Tutorial 1.
1028
Tutorials 2 and 3 are the minimum to get started with R development.
1129
You can run through these in about 30 minutes.
@@ -19,9 +37,6 @@ You can refer to the remaining sections as needed!
1937
6. [Multiple R versions](docs/tutorials/multi_r_compilation.md)
2038
7. [SVN Help](docs/tutorials/svn_help.md)
2139

22-
## Other Docs
40+
## Further docs
2341

24-
- [Restarting And Stopping Codespace](docs/container_setup/codespacestartstop.md)
25-
- [Collaborating with Live Share]((docs/container_setup/live_share.md))
26-
- [Using R Dev Container Locally](docs/container_setup/localsetup.md)
27-
- [Useful Resources](docs/resources.md)
42+
See the [full documentation](https://contributor.r-project.org/r-dev-env/) for background information on this project, how to contribute to the [documentation](docs/contributor_guide/contributing_to_docs.md) or the [codebase](docs/contributor_guide/contributing_to_codebase.md), [external resources](docs/resources.md) and [troubleshooting](docs/troubleshoot.md).

NEWS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## R Development Container 0.3
2+
3+
- Implemented Gitpod setup with GitHub Actions workflow to build Docker images for the Gitpod workspace.
4+
- Improved `which_r` script with version choice validation and updated both `which_r` and `set_build_r` scripts for enhanced functionality.
5+
- Resolved local setup permission issues to ensure smoother operation within the devcontainer environment on Linux.
6+
- Restructured documentation to incorporate Gitpod alternative setup.
7+
- Implemented a workflow to optimize images so that documentation files are more lightweight.
8+
9+
10+
111
## R Development Container 0.2
212

313
- Documentation split into set of markdown files. These are used to create the documentation website https://contributor.r-project.org/r-dev-env/ and the user-focused pages can be accessed directly within the codespace, linked from an index that opens when the codespace first starts. New documentation pages/topics:

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.2.0
1+
0.3.0

0 commit comments

Comments
 (0)