TSYS Group - Engineering Documentation - Visual Studio Code Environment Setup Guide
- TSYS Group - Engineering Documentation - Visual Studio Code Environment Setup Guide
Introduction
This is the TSYS Visual Studio Code setup guide. It covers how to setup VsCode for all aspects of TSSY Group.
We have a very complex total stack, but don't despair, you will only need a small subset of this.
Which subset of course depends on what part of the TSYS mission you are supporting!
Environmental considerations/assumptions
-
Charles setup is the most comprehensive, as he is the CTO and has/does need to develop for all pieces of the stack/products.
-
Do not just blindly follow this guide! Pick the pieces you need for your work. If you have any questions, ask in Discord or post to Discourse.
-
Working against a remote server/container/k8s cluster over SSH via VsCode Remote
-
VsCode Remote Dev is heavily utilized (almost if not exclusively)
-
Source code resides in home directory on the server farm, but is edited "locally" on your workstation with VsCode (Remote)
-
Using TSYS self hosted Gitea git instance
-
Using TSYS self hosted Jenkins CI
-
docker/kubectl commands are present and configured to run against the cluster (and you are connected to the VPN)
-
Developing in Windows 10/Mac OSX/Linux with a GUI environment running native VsCode (CNW daily driver is a raspberry pi 4 with 8gb ram to help ensure lowest common denominator support/good performance)
-
Using Chrome web browser (firefox/safari may work, but are not supported at all)
-
Developing primarily at the "git push, magic happens" abstraction layer
-
Need to occasionally inspect/debug the magic at various stages of the pipeline
-
Need to frequently debug running code on a variety of targets (pi/arduino etc)
-
All text documentation is written in Markdown and is posted to Git/Discourse as Markdown
-
(tbd soon, actively experimenting) All diagrams are produced using (blockdiag? uml? markdown? all the above? extension(s))
Short version
very soon (may 2021) you'll have two options for EZ stack deployment for your product development environment :
-
docker pull TSYSVSC and use with https://code.visualstudio.com/docs/remote/containers
-
Browse to https://desktop.turnsys.com and get a full engineering stack for whatever product you are working on.
Read on to understand the pieces and particulars in case you want to build your own setup.
Requirements and dependencies
Here is the tool and language requirements of all the TSYS engineering projects/programs/products.
Software Programs Used
You'll need to setup some subset of the tools below todo your job (in addition to VsCode), and also use VsCode with various TSYS hosted services like Gitea, Jenkins and Docker/K3s.
Setup of external tools is outside the scope of this document. For guidance on tool setup, please see the following links:
- https://git.turnsys.com/mrcharles/dotfiles/
- https://git.turnsys.com/MorseFlyer/docs
- https://git.turnsys.com/TSGTechops/docs-techops
This software has two modes of deployment:
- downloaded from the vendor and setup on your physical workstation (used for dev/testing/experimenting)
- downloaded from the /subo directory and ran on your physical workstation or run from the /subo directory on a virtual workstation you login to remotely
The software that is built/deployed in /subo is the only version approved for production use.
The exception to that is if it has an OTS notation next to it's name, in which case you can use the latest stable version from the vendor.
Once you've setup your needed external tools, return to this document and continue with setup of VsCode as needed to work with the tooling you installed.
Program | Used By | Link | Product Scope |
---|---|---|---|
obs (OTS) | All | https://obsproject.com/ | All |
bitwaden (OTS) | All | https://bitwarden.com/ | All |
docear (OTS) | All | https://docear.org/ | All |
polar (OTS) | All | https://getpolarized.io/ | All |
calibre (OTS) | All | https://calibre-ebook.com/ | All |
vym (OTS) | All | http://www.insilmaril.de/vym/ | All |
argouml (OTS) | All | https://github.com/argouml-tigris-org/argouml | All |
bonita (OTS) | All | https://www.bonitasoft.com/ | All |
Docker Desktop (OTS) | All | https://www.docker.com/products/docker-desktop | All |
Pandoc (OTS) | All | https://pandoc.org/ | All |
Esim | Team-HwEng | https://esim.fossee.in/ | MorseFlyer (avionics), MorseSkynet |
Kicad | Team-HwEng | https://gitlab.com/kicad/code/kicad | MorseFlyer (avionics), MorseSkynet |
LibrePCB | Team-hwEng | https://librepcb.org/ | MorseFlyer (avionics), MorseSkynet |
NgSpice | Team-HwEng | http://ngspice.sourceforge.net/resources.html | MorseFlyer (avionics), MorseSkynet |
qrouter | Team-HwEng | http://opencircuitdesign.com/qrouter/ | MorseFlyer (avionics), MorseSkynet |
Gerby | Team-HwEng | http://gerbv.geda-project.org/ | MorseFlyer (avionics), MorseSkynet |
camotics | Team-MechEng | https://camotics.org/ | MorseFlyer (avionics), MorseSkynet |
GprMax | Team-HwEng | https://github.com/gprMax/gprMax | MorseFlyer (avionics), MorseSkynet |
SciKit-RF | Team-HwEng | https://scikit-rf.readthedocs.io/en/latest/ | MorseFlyer (avionics), MorseSkynet |
Flora | Team-HwEng/SwEng | https://flora.aalto.fi/ | MorseFlyer (avionics), MorseSkynet |
inkscape | Team-HwEng/MechEng | https://inkscape.org/ | MorseFlyer, MorseSkynet |
gerber2graphtec | Team-HwEng | https://github.com/pmonta/gerber2graphtec | MorseFlyer, MorseSkynet |
gerber2graphtec | Team-HwEng | https://github.com/colinoflynn/gerber2graphtec/> | MorseFlyer, MorseSkynet |
Blender | Team-MechEng/HwEng | https://www.blender.org/ | MorseFlyer, MorseSkynet |
Freecad | Team-MechEng/HwEng | https://github.com/FreeCAD | MorseFlyer, MorseSkynet |
Librecad | Team-MechEng/HwEng | https://librepcb.org/ | MorseFlyer, MorseSkynet |
Solvespace | Team-MechEng | https://solvespace.com/index.pl | MorseFlyer, MorseSkynet |
Cura | Team-MechEng | https://ultimaker.com/software/ultimaker-cura | MorseFlyer (envelope/parafoil/airframe) |
Cubit Toolkit | Team-MechEng | https://cubit.sandia.gov/ | MorseFlyer (envelope/parafoil/airframe) |
Paraview | Team-MechEng | https://www.paraview.org/ | MorseFlyer (envelope/parafoil/airframe) |
Octave | Team-MechEng | https://hg.savannah.gnu.org/hgweb/octave | MorseFlyer (envelope/parafoil/airframe) |
OpenVSP | Team-MechEng | http://openvsp.org/ | MorseFlyer (envelope/parafoil/airframe) |
OneLAB | Team-MechEng | http://onelab.info/ | MorseFlyer (envelope/parafoil/airframe) |
SciLab | Team-MechEng | https://www.scilab.org/ | MorseFlyer (envelope/parafoil/airframe) |
Warp3d | Team_MechEng | http://www.warp3d.net/ | MorseFlyer (envelope/parafoil/airframe) |
CodeAster | Team-MechEng | https://www.code-aster.org/V2/spip.php?rubrique2 | MorseFlyer (envelope/parafoil/airframe) |
VirtualSatellite | Team_MechEng | https://github.com/virtualsatellite | MorseFlyer (envelope/parafoil/airframe) |
NasaTrick | Team_MechEng | https://github.com/nasa/trick | MorseFlyer (envelope/parafoil/airframe) |
NasaTran95 | Team_MechEng | https://github.com/nasa/trick | MorseFlyer (envelope/parafoil/airframe) |
rstudio (OTS) | Team-HwEng | https://www.rstudio.com/ | MorseFlyer (envelope/parafoil/airframe) |
DbEaver(OTS) | Team-SwEng | https://dbeaver.io/ | MorseFlyer(avionics), RacKRental.net, HFNOC |
CUDA SDK | Team-HwEng | https://developer.nvidia.com/cuda-zone | MorseFlyer (envelope/parafoil/airframe) |
Microsoft R (OTS) | Team-HwEng | https://mran.microsoft.com/open | MorseFlyer (avionics) |
open 3d model viewer | Team-MechEng | https://acgessler.github.io/open3mod/ | MorseFlyer (envelope/parafoil/airframe) |
PHP runtime | Team-SwEng | http://devilbox.org/ | RackRental |
postman (OTS) | Team-SwEng | https://www.postman.com/ | RackRental/HFNOC |
xilinx | Team-HwEng | https://www.xilinx.com/ | MorseSkynet |
sdrsharp | Team-HwEng | https://www.rtl-sdr.com/tag/sdrsharp/ | MorseSkynet |
gnuradio | Team-HwEng | https://www.gnuradio.org/ | MorseSkynet |
Xilinx | Team-HwEng | https://www.xilinx.com/support/download.html | MorseSkynet |
YoSys | Team-HwEng | http://www.clifford.at/yosys/ | MorseSkynet |
graywolf | Team-HwEng | https://github.com/rubund/graywolf | MorseSkynet |
chisel | Team-HwEng | https://www.chisel-lang.org/ | MorseSkynet |
embitz (OTS) | Team-SwEng/HwEng | https://www.embitz.org/ | MorseSkynet |
android studio (OTS) | Team-SwEng | https://developer.android.com/studio | MorsePod |
grass gis (OTS) | Team-SwEng | https://grass.osgeo.org/ | HFNOC |
qgis (OTS) | Team-SwEng | https://qgis.org/en/site/ | HFNOC |
udig (OTS) | Team-SwEng | http://udig.refractions.net/ | HFNOC |
OpenGribs | Team-SwEng | https://opengribs.org/en/ | HFNOC |
worldwind (OTS) | Team-HwEng | https://worldwind.arc.nasa.gov/ | HFNOC |
sweethome3d (OTS) | Team-MechEng | http://www.sweethome3d.com/ | MorseCollective |
jxplorer (OTS) | Team-IT | http://jxplorer.org/ | HFNOC/HFNFC |
ghidra (OTS) | Team-SwEng | https://ghidra-sre.org/ | ALl (SDLC) |
openscap (OTS) | Team-IT | https://www.open-scap.org/tools/scap-workbench/ | All (SDLC) |
metasploit | Team-SwEng | https://github.com/rapid7/metasploit-framework/wiki/Nightly-Installers | All (SDLC) |
OWASP Threat Dragon | Team-SwEng | https://owasp.org/www-project-threat-dragon/ | All (SDLC) |
Languages Used
Language | Used By | Product Scope |
---|---|---|
bash | TSYS wide | All |
Markdown | TSYS wide | All |
dockerfile/docker compose | TSYS wide | All |
helm charts | TSYS wide | All |
YAML | TSYS wide | All |
c/c++ | Team-SwEng | MorseFlyer |
Java | Team SwEng | MorseTrackerHUD,MorseTracker |
javascript | Team SwEng | MorseTrackerHUD |
Some geo spatial stuff | Team SwEng | MorseFlyer (avionics) |
Gerber | Team HwEng | MorseSkynet, MorseFlyer (avionics) |
tcl/tk | Team HwEng | MorseSkynet |
Xilinx | Team HwEng | MorseSkynet |
CUDA | Team MechEng | MorseFlyer (envelope/airframe) |
python (Jupyter and stand alone) | Team MechEng | MorseFlyer (envelope/airframe) |
octave | Team MechEng | MorseFlyer (envelope/airframe) |
R | Team MechEng | MorseFlyer (envelope/airframe) |
PHP | TEam-SwEng | RackRental.net , HFNOC/HFNFC |
OpenFAAS | Team-SwEng | RackRental.net |
Ruby | Team-SwEng | All (as part of SDLC testing) |
Deployment Targets
Target | Used By | Product Scope |
---|---|---|
Raspberry Pi (cross compiled) | Team-SwEng | MorseFlyer (Avionics) |
Arduino (cross compiled) | Team-SwEng | MorseFlyer (Avionics) |
FreeRTOS (cross compiled) | Team-SwEng | MorseFlyer (Avionics) |
TSYS Web Farm (lots of PHP (wordpress etc)) | Team-WebEng | RackRental.net, HFNOC, HFNFC |
Subo pi farm (multi arch) Docker / k3s (and balena) | Team-SwEng | MorseFlyer (Avionics), MorseSkynet |
OpenMCT farm (java/micro services) | Team-SwEng | MorseTracker/MorseTrackerHUD |
TSYS K3S sandbox/dev/prod clusters | All teams | All |
Jenkins build pipelines | All teams | All |
General setup
These are steps you need to take before starting development in earnest.
Linux (or at least a mostly linux (WSL/mobaxterm)) environment is presumed for all the below.
You may well find GUI replacements and use them, especially on Windows/MACOSX. They are not supported in any way.
- Setup gitea
- Login once to https://git.turnsys.com so you can be added to the appropriate repos/teams/orgs.
- Customize any profile etc settings that you wish.
- Setup SSH
- Setup SSH key
- Add SSH public key to gitea
- Setup git
- For all git users:
- $ git config --global user.name "John Doe"
- $ git config --global user.email johndoe@example.com
- Setup git lg : git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
- for zsh users (and you really should use zsh/oh-my-zsh :)
- git config --add oh-my-zsh.hide-status 1
- git config --add oh-my-zsh.hide-dirty 1
- For all git users:
Plugins - Team-*
The plugins documented here are known to work, and are in active/frequent use by Charles as CTO as he hacks on the stack. Other options exist for almost all the below. If you find something that works better for you, use it!
Consider the below as a suggested/supported baseline.
General Tooling
- Code Spell Checker https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker
- Vim https://marketplace.visualstudio.com/items?itemName=vscodevim.vim
Docker / k8s
- Docker:
- Docker explorer https://marketplace.visualstudio.com/items?itemName=formulahendry.docker-explorer
- Bridge to K8s https://marketplace.visualstudio.com/items?itemName=mindaro.mindaro https://code.visualstudio.com/docs/containers/bridge-to-kubernetes
Git
- Git Extension Pack https://marketplace.visualstudio.com/items?itemName=donjayamanne.git-extension-pack
- Git Tree Compare https://marketplace.visualstudio.com/items?itemName=letmaik.git-tree-compare
- Git Tags https://marketplace.visualstudio.com/items?itemName=howardzuo.vscode-git-tags
- Gitea-VsCode https://marketplace.visualstudio.com/items?itemName=ijustdev.gitea-vscode
Remote development/debug
THis is used regularly by Techops and Charles and is well supported.
- https://code.visualstudio.com/docs/remote/remote-overview
- https://code.visualstudio.com/docs/remote/ssh
Cross Compile / Remote Debug
- https://dimamoroz.com/2021/03/09/intel-nuc-for-development/
- https://github.com/Ed-Yang/rpidebug
- https://enes-ozturk.medium.com/remote-debugging-with-gdb-b4b0ca45b8c1
- https://enes-ozturk.medium.com/cross-compiling-with-cmake-and-vscode-9ca4976fdd1
Markdown
- Gitdoc https://marketplace.visualstudio.com/items?itemName=vsls-contrib.gitdoc
- Markdown All in One https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one
- Markdown Preview Enhanced https://shd101wyy.github.io/markdown-preview-enhanced/
- markdownlint https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint
- PlantUML
Bash
Plugins - Team-SWEng
YAML
C/C++
- https://ludwiguer.medium.com/configure-visual-studio-code-to-compile-and-run-c-c-3cef24b4f690
- https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools-extension-pack0
- https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner
Arduino/Seeduino
-_https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.vscode-arduino
CUDA
TBD. Pull requests welcome.
Java
PHP
Geospatial
Python
Plugins - Team-MechEng
Octave
TBD. Pull requests welcome.
R
TBD. Pull requests welcome.
Jupyter
STL
- https://marketplace.visualstudio.com/items?itemName=xdan.stlint-vscode-plugin
- https://marketplace.visualstudio.com/items?itemName=md2perpe.vscode-3dviewer
- https://marketplace.visualstudio.com/items?itemName=slevesque.vscode-3dviewer
G-code
TBD. Pull requests welcome.
Gerber
TBD. Pull requests welcome.