Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Update the R definition #954

Merged
merged 4 commits into from
Jul 30, 2021
Merged

Update the R definition #954

merged 4 commits into from
Jul 30, 2021

Conversation

eitsupi
Copy link
Contributor

@eitsupi eitsupi commented Jul 20, 2021

cc @kmehant @Ikuyadeu @randy3k @renkun-ken

@eitsupi
Copy link
Contributor Author

eitsupi commented Jul 21, 2021

By the way, the current R definition says that it doesn't work with Codespaces, but containers and extensions for R have changed a lot between when this research was done 5ca22d1 and now.

I'd like to find out what's going on now if I could, but I don't have access to Codespaces so I can't find out...

@renkun-ken
Copy link

Is there a way to get access to codespaces for container maintainers?

@renkun-ken
Copy link

@eitsupi Do you think we should also add R Debugger and also install vscDebugger to provide a full R development experience including debugging?

@eitsupi
Copy link
Contributor Author

eitsupi commented Jul 21, 2021

@renkun-ken Yes, it would be great if it could be added.
I also considered adding it when I added the current definition in #732, but I had never used the R Debugger myself, so I decided to forgo it.

And, it would be ideal to have the httpgd package installed as well, but the current container takes about 10 minutes to build, so I decided to forgo it this time.
(Half of the build time is spent running common-debian.sh in this repository, and the other half is installing R packages)

If we can use images pre-built by REditorSupport, which owns the vscode-R extension and the languageserver package, as Julia's definition added in #450, users can easily use R in Remote-Containers (and Codespaces) with more pre-installed packages in container.

@renkun-ken
Copy link

Thanks for pointing to the Julia's devcontainer. We'll probably maintain some pre-built images under REditorSupport.

- install the httpgd package
- add R session watcher settings
- add radian to integrated terminal
@eitsupi
Copy link
Contributor Author

eitsupi commented Jul 24, 2021

@renkun-ken Once again, I thought about the container settings and tried various things, and I think it is indeed significant to provide a better R development environment with VSCode as you said, so I would like to add the following settings.

  • Add the httpgd package and use it by default (httpgd's plots are really nice!)
  • Edit the Rprofile to enable self-managed R sessions
  • Add integrated terminal profile for radian

Since the base image rocker/r-ver installs packages from past CRAN snapshots by default, images tagged with versions earlier than httpgd was registered with CRAN will fail to install httpgd.
Therefore, I have updated the comments to raise the minimum version to R 4.0.3.

I decided not to install the vscDebugger package because it is not registered with CRAN and I cannot eliminate the possibility of version inconsistencies with dependent packages installed from past CRAN mirrors.
And, if we add the R Debugger, we might have to add launch.json and update the sample project and documentation.

@renkun-ken
Copy link

Thanks for the nice work!

I decided not to install the vscDebugger package because it is not registered with CRAN and I cannot eliminate the possibility of version inconsistencies with dependent packages installed from past CRAN mirrors.

From the DESCRIPTION, vscDebugger only depends on jsonlite and R6 with no specific minimum version requirement. I'm not sure what you mean by "version inconsistencies with dependent packages"?

And, if we add the R Debugger, we might have to add launch.json and update the sample project and documentation.

The current R Debugger has built-in configs to work out of the box for most cases. I guess we don't have to add launch.json for now.

@eitsupi
Copy link
Contributor Author

eitsupi commented Jul 24, 2021

From the DESCRIPTION, vscDebugger only depends on jsonlite and R6 with no specific minimum version requirement. I'm not sure what you mean by "version inconsistencies with dependent packages"?

Does it seem unlikely that a future update of vscDebugger will require version restrictions? @ManuelHentschel
(Of course, if that's the case, we could just update the Dockerfile to fix it, so maybe I'm worrying too much)

Also, I can't decided whether it's better to install from the latest GitHub commit at the docker build stage or by using the command from R Debugger.
I believe it is possible to install from the latest release using the GitHub API, but I feel it is too long to write in this Dockerfile...

The current R Debugger has built-in configs to work out of the box for most cases. I guess we don't have to add launch.json for now.

Thank you for telling me about it. I don't understand too much about the R Debugger (and about debugging tasks in R), so I'll try to use it tomorrow.

@eitsupi
Copy link
Contributor Author

eitsupi commented Jul 25, 2021

I'm sorry, I've touched the R Debugger, but I don't understand the proper launch.json and test-project configuration at this time, and I can't decide if I should include the vscDebugger package in the Dockerfile.
Please let me exclude the addition of R Debugger from this PR.
(Please compare "r" with containers in other languages, e.g. "python-3", for the need to add launch.json.)

For example, I considered the following launch.json, but I think it would confuse users because the session started in the debug console by pressing F5 and the R Debugger is completely different from the session started by pressing the Run button on vscode-R.
(README.md for the other language definitions which contains launch.json says to press F5 to run the sample project.)

{
	"version": "0.2.0",
	"configurations": [
		{
			"type": "R-Debugger",
			"name": "Debug R-File",
			"request": "launch",
			"debugMode": "file",
			"workingDirectory": "${workspaceFolder}",
			"file": "${workspaceFolder}/test-project/hello.R"
		}
	]
}

@Chuxel
Copy link
Member

Chuxel commented Jul 30, 2021

LGTM!

@Chuxel Chuxel merged commit 2f29c8e into microsoft:main Jul 30, 2021
vscode-dev-containers Planning automation moved this from PRs that need attention 🙏 to Done 🎉 Jul 30, 2021
@eitsupi eitsupi deleted the update-r-container branch July 31, 2021 04:33
@eitsupi
Copy link
Contributor Author

eitsupi commented Jul 31, 2021

Thank you for merging !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants