Skip to content

Commit

Permalink
Merge pull request #186 from r-devel/devel
Browse files Browse the repository at this point in the history
Version 0.3 release
  • Loading branch information
hturner authored Sep 4, 2024
2 parents af7ea6e + 7650b12 commit ec9a4c5
Show file tree
Hide file tree
Showing 36 changed files with 642 additions and 322 deletions.
64 changes: 25 additions & 39 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,31 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
{
"name": "R-Dev-Env",
"image": "ghcr.io/r-devel/r-dev-env:main",
"hostRequirements": {
"cpus": 4
},

"customizations": {
"vscode": {
"settings": {
"r.lsp.diagnostics": false,
"r.plot.useHttpgd": true,
"r.rpath.linux": "/usr/bin/R",
"r.rterm.linux": "/usr/bin/R",
"terminal.integrated.sendKeybindingsToShell": true,
"svn.multipleFolders.enabled": true,
"name": "R-Dev-Env",
"image": "ghcr.io/r-devel/r-dev-env:main",
"hostRequirements": {
"cpus": 4
},
"customizations": {
"vscode": {
"settings": {
"r.lsp.diagnostics": false,
"r.plot.useHttpgd": true,
"r.rpath.linux": "/usr/bin/R",
"r.rterm.linux": "/usr/bin/R",
"terminal.integrated.sendKeybindingsToShell": true,
"svn.multipleFolders.enabled": true,
"workbench.editorAssociations": {
"*.md": "vscode.markdown.preview.editor"
},
"workbench.welcomePage.walkthroughs.openOnInstall": false
},
"extensions": [
"REditorSupport.r",
"mads-hartmann.bash-ide-vscode",
"johnstoncode.svn-scm",
"ms-vscode.cpptools",
"MS-vsliveshare.vsliveshare"
]
}

},
"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"
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "gcc -v",
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
},
"extensions": [
"REditorSupport.r",
"mads-hartmann.bash-ide-vscode",
"johnstoncode.svn-scm",
"ms-vscode.cpptools",
"MS-vsliveshare.vsliveshare"
]
}
},
"postCreateCommand": "chown -R vscode:vscode /workspaces/r-dev-env && sh /workspaces/r-dev-env/scripts/localscript.sh"
}
69 changes: 69 additions & 0 deletions .github/workflows/build-gitpod-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Build and publish Gitpod Docker image

on:
workflow_dispatch:
pull_request:
branches: ["main","devel"]
types: [closed]
paths:
- '.github/workflows/build-gitpod-image.yml'
- '.gitpod.Dockerfile'
- '.gitpod.yml'
- 'reinstall-cmake.sh'
- 'VERSION'


env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
if: ${{github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true}}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Extract version number
run: |
VER=$(cat VERSION)
echo "VERSION=$VER" >> $GITHUB_ENV
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{ env.VERSION }}
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: .gitpod.Dockerfile
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:gitpod.${{ github.ref_name }}
build-args: |
CONTAINER_VERSION=${{ env.VERSION }}
labels: ${{ steps.meta.outputs.labels }}
44 changes: 44 additions & 0 deletions .github/workflows/optimize-docs-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Optimize Docs Images

on:
pull_request:
branches: ["main","devel"]
types: [closed]
paths:
- 'docs/assets/**'

jobs:
optimize-images:
if: ${{github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true}}
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup R
uses: r-lib/actions/setup-r@v2

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libmagick++-dev libcurl4-openssl-dev
- name: Install R packages
run: |
R -e 'install.packages(c("magick"), repos = "https://cloud.r-project.org/")'
- name: Optimize images
run: |
Rscript ./scripts/optimize.R
- name: Commit and push optimized images
if: github.ref == 'refs/heads/devel' && github.event_name == 'push'
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add docs/assets
git commit -m 'Optimize docs images'
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34 changes: 34 additions & 0 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM gitpod/workspace-full:latest

USER root

ARG REINSTALL_CMAKE_VERSION_FROM_SOURCE="none"

# Optionally install the cmake for vcpkg
COPY ./reinstall-cmake.sh /tmp/

RUN if [ "${REINSTALL_CMAKE_VERSION_FROM_SOURCE}" != "none" ]; then \
chmod +x /tmp/reinstall-cmake.sh && /tmp/reinstall-cmake.sh ${REINSTALL_CMAKE_VERSION_FROM_SOURCE}; \
fi \
&& rm -f /tmp/reinstall-cmake.sh

RUN sed -i.bak "/^#.*deb-src.*universe$/s/^# //g" /etc/apt/sources.list \
&& echo "deb https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/" >> /etc/apt/sources.list \
&& 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 \
&& apt update \
&& apt -y install subversion \
&& apt -y build-dep r-base-dev \
&& apt -y install r-base-dev \
&& apt -y install valgrind \
&& Rscript -e "install.packages('languageserver', repos='https://cran.rstudio.com')" \
&& Rscript -e "install.packages('httpgd', repos='https://cran.rstudio.com')"

RUN apt install -y shellcheck
RUN apt install -y ccache
RUN apt install -y rsync
#RUN /usr/sbin/update-ccache-symlinks
#RUN echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a /home/vscode/.bashrc


ARG CONTAINER_VERSION
ENV CONTAINER_VERSION ${CONTAINER_VERSION}
13 changes: 13 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
image: ghcr.io/r-devel/r-dev-env:gitpod.devel

tasks:
- name: Initial Setup for R-dev-env Gitpod Workspace
before: |
bash /workspace/r-dev-env/scripts/localscript.sh
source ~/.bashrc
vscode:
extensions:
- REditorSupport.r
- johnstoncode.svn-scm
35 changes: 20 additions & 15 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: Shirdhankar
given-names: Atharva
- family-names: Turner
given-names: Heather
- family-names: Tripp
given-names: James
- family-name: Emsley
given-names: Iain
title: "R Development Container"
version: 0.2.0
doi:
date-released: 28-06-2024
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: Shirdhankar
given-names: Atharva
- family-names: Turner
given-names: Heather
- family-names: Tripp
given-names: James
- family-name: Emsley
given-names: Iain
- family-names: Crespo
given-names: Lorena
- family-names: Campitelli
given-names: Elio

title: "R Development Container"
version: 0.3.0
doi:
date-released: 04-09-2024
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ RUN apt install -y ccache
#RUN echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a /home/vscode/.bashrc


ENV BUILDDIR="/workspaces/r-dev-env/build/r-devel"
ENV TOP_SRCDIR="/workspaces/r-dev-env/svn/r-devel"
ENV PATCHDIR='/workspaces/r-dev-env/patches'

ARG CONTAINER_VERSION
ENV CONTAINER_VERSION ${CONTAINER_VERSION}
27 changes: 21 additions & 6 deletions INDEX.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,27 @@
If you haven't seen them yet, you can find the
[R Dev Container Docs](https://contributor.r-project.org/r-dev-env/) online.

This index links to underlying markdown files for key sections of the docs, so you can preview them right here in VS Code.

## Working with the container

The links below give more information on using the container via GitHub Codespaces or Gitpod Workspaces.
Take a moment to review how to stop and restart your container, so you can continue your work.
If you are collaborating with others, you may want to use Live Share so that you can share the same workspace.

### Github Codespace

- [Stopping and Restarting Codespace](docs/container_setup/github_codespace/codespacestartstop.md)
- [Collaborating with Live Share](docs/container_setup/github_codespace/live_share.md)

### Gitpod Workspace

- [Stopping and Restarting Codespace](docs/container_setup/gitpod_workspace/workspacestop_and_restart.md)
- [Collaborating with Live Share](docs/container_setup/gitpod_workspace/live_share.md)

## Tutorials

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

## Other Docs
## Further docs

- [Restarting And Stopping Codespace](docs/container_setup/codespacestartstop.md)
- [Collaborating with Live Share]((docs/container_setup/live_share.md))
- [Using R Dev Container Locally](docs/container_setup/localsetup.md)
- [Useful Resources](docs/resources.md)
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).
10 changes: 10 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## R Development Container 0.3

- Implemented Gitpod setup with GitHub Actions workflow to build Docker images for the Gitpod workspace.
- Improved `which_r` script with version choice validation and updated both `which_r` and `set_build_r` scripts for enhanced functionality.
- Resolved local setup permission issues to ensure smoother operation within the devcontainer environment on Linux.
- Restructured documentation to incorporate Gitpod alternative setup.
- Implemented a workflow to optimize images so that documentation files are more lightweight.



## R Development Container 0.2

- 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:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.0
0.3.0
Binary file added docs/assets/gitpod1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/gitpod2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/gitpod3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/gitpod4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/gitpod5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/gitpod6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/manage_codespace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/manage_workspace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 0 additions & 31 deletions docs/container_setup/codespacestartstop.md

This file was deleted.

Loading

0 comments on commit ec9a4c5

Please sign in to comment.