Code Monkey home page Code Monkey logo

devserver's Introduction

Develop Server Environment Hosted on HomeLab

Linux distribution

RDP options

  • No good option for the time being, tried nomachine, anydesk, tigervnc, all without luck

Code Editor

  • code-server: basically vscode via browser
  • pamac build code-server
  • settings.json location: /home/cs/.local/share/code-server/User/settings.json

Source code directory

  • Mount NFS directory: /mnt/sample-pool/nfs
  • Use systemd to auto mount on startup
  • sudo systemd-escape -p --suffix=mount '/mnt/nfs': Where= must be matched to the unit name
  • sudo systemctl enable mnt-nfs.mount --now
# /etc/systemd/system/mnt-nfs.mount
[Unit]
Description=NFS from TrueNAS
After=network.target

[Mount]
What=192.168.x.x:/mnt/path/nfs
Where=/mnt/nfs
Type=nfs
Options=_netdev,auto

[Install]
WantedBy=multi-user.target

Setup static IP

Disable sleep and hibernate

sudo systemctl mask suspend.target hibernate.target sleep.target
sudo systemctl unmask suspend.target hibernate.target sleep.target

Install rstudio-server

sudo pamac build rstudio-server-bin
sudo useradd --system rstudio-server
sudo rstudio-server verify-installation
sudo systemctl start rstudio-server

In rstudio can use py_config() to check who the python path is determined, e.g.

  • by conda
  • by environment variable RETICULATE_PYTHON_FALLBACK

Then login with your default linux user

Install tensflow with CUDA support

sudo pacman -S tensorflow-cuda python-tensorflow-cuda

Sometimes, you may want to benchmark again CPU, can use Sys.setenv(CUDA_VISIBLE_DEVICES = -1) to disable CUDA support

NOTE:

  • ArchLinux update is rolling based, which makes the dependencies in relation to CUDA unstable; in this case, conda is preferred.
  • However, conda doesn't work well with tensorflow[and-cuda] for 2.11-2.15
  • So, elder version tensorflow-gpu==2.10.0 is more stable, can test again when tensorflow 2.16 is released

Quick start with conda:

conda_create(env_name, python_version = "3.10")  # python 3.10 is latest version compatible with tensorflow 2.10
use_condaenv(condaenv = env_name)
reticulate::conda_install(envname = env_name, packages = c("tensorflow-gpu==2.10.0"))
reticulate::import("tensorflow")
tf$sysconfig$get_build_info()

reticulate's conda can be used in shell after init, e.g. ~/.local/share/r-miniconda/bin/conda init zsh

Install torch with CUDA support

  • In rstudio, can combine use_virtualenv and py_install(..., pip = TRUE) to install pytorch with CUDA support
  • then, set CUDA version via sys.setenv accordingly
  • then, install mlverse/torch
  • If certain .so files cannot be found, just use find and copy them over

Free disk space

sudo pacman -Sc
sudo pacman -Qdt
sudo pacman -Rns $(pacman -Qtdq)
sudo journalctl --vacuum-size=50M

Install RStudio Server from Source (MacOS M1) (NOT able to successfully install, recommend Juypter Lab)

  • See: M1 Mac Dev Machine Setup
  • install-dependencies-osx shall be install-dependencies-osx-arch
  • soci error
    • brew install soci
    • update the CMakeLists.txt from set(SOCI_LIBRARY_DIR "${RSTUDIO_TOOLS_SOCI}/build/lib") to set(SOCI_LIBRARY_DIR "/opt/homebrew/lib")
    • actually the above may be avoided using by install the dependences in dependencies/common/install-soci
  • dependencies/common/install-soci
  • sudo cp /etc/pam.d/cups /etc/pam.d/rstudio
  • In order to open the GWT Development Mode, need to login to the desktop GUI

ASDF + Conda + Jupyter Lab + rpy2 (MacOS M1)

  • conda active, then Jupyter Lab
  • Jupyter Extensions:
    • jupyter-lsp-jupyterlab-lsp
    • jupyterlab-jupytext (For Rmd and qmd support)
conda install r-recommended r-irkernel
R -e 'IRkernel::installspec()'
conda install -y -c apple tensorflow-deps
python -m pip install tensorflow-macos
python -m pip install tensorflow-metal

devserver's People

Contributors

carolusian avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.