samples

module
v0.0.0-...-a04e50b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2024 License: GPL-3.0

README

Samples

Language samples.

Purpose

The purpose of this module is to showcase intermediate and advanced concepts of the language.
This is not a complete or whole set and is not meant as a finished library nor production ready.
This is meant for learnings and tutorials that can be successfully compiled and executed.
Purpose of which is to use as a collection of code snippets that cover a broad list of categories.

Installation

To configure VS Code with GCC, GDB, and WSL, follow this link

To install dependencies, run:

./install.sh

Docker

There is a Dockerfile that creates a full install of all dependencies for a self-hosted runner. To install the self-hosted runner, a TOKEN parameter needs tobe supplied, which provides authentication. Get the token, follow self-hosted runner instructions below.

./docker/docker_build <TOKEN> <REPO_TAG>
./docker/docker_build <TOKEN> github.actions.runner.ubuntu-22.04
Container Start Command

The following command may need to be added in the right place in order to start the container:

/etc/init.d/boot-script start

Go

Go development tutorial can be found here

Buf and Connect

Follow these links to setup Buf and Connect-go to auto generate API code from .proto files. To keep versions updated, install go-mod-upgrade

Run

To execute this module in Linux, run:

python3 test_runner.py

Programming Languages

Intermediate+ Level Skills

  1. C++
  2. Python
  3. Go

GitHub

The following is a list of GitHub workflows supported:

Workflow Description
build_libraries.yaml Installs dependencies, libraries, and uploads artifacts.
build.yaml Installs dependencies, downloads artifacts, builds, and runs all tests.

Self-Hosted Runners

Add self-hosted runners by following this link

Start Service on Boot

Configure the self-hosted runner application as a service to start on boot here
Note: Handle the User used to start the self-hosted runner applications. The user may be set in /etc/systemd/system/actions.runner.<githubuser>-<repo>.<host>.service

To find the service name in the list of running services on Linux systems:

$ systemctl --type=service | grep actions.runner
actions.runner.<hostname>.service loaded active running GitHub Actions Runner (<hostname>)
Non-systemd Boot Systems

If your system boots with init.d, perform the following steps to launch the actions runner as a service:

  1. Copy boot-script to init.d:
sudo cp scripts/init.d/boot-script /etc/init.d
  1. Update paths as necessary.
  2. Copy actions.runner.service.template to init.d:
sudo cp scripts/init.d/actions.runner.service.template /etc/init.d
  1. Make the script executable:
sudo chmod +x /etc/init.d/boot-script
  1. Update the rc.d system links (to start script on boot):
sudo update-rc.d boot-script defaults

If the above fails, link it to the booter:

sudo ln -s /etc/init.d/boot-script /etc/rc2.d/S20boot-script
  1. (Optional) Start the service:
sudo service boot-script start
  1. (Optional) Check service status
sudo service boot-script status

If all else fails, use manual mode to start the service:

./bin/runsvc.sh ./bin/actions.runner.service.template

Directories

Path Synopsis
internal
assert
Package assert is a minimal assert package using generics.
Package assert is a minimal assert package using generics.
ecommerce
main.go
main.go
ecommerce/cart
cart/cart.go
cart/cart.go
ecommerce/inventory
inventory/inventory.go
inventory/inventory.go
ecommerce/utils
utils/helper.go
utils/helper.go
tests
go/types Module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL