Skip to content

Instantly share code, notes, and snippets.

@fire
Created January 22, 2024 03:06
Show Gist options
  • Save fire/fcd2d7e3e10b18265fa3d5934fb2237e to your computer and use it in GitHub Desktop.
Save fire/fcd2d7e3e10b18265fa3d5934fb2237e to your computer and use it in GitHub Desktop.
Proposed: Overcoming a V-Sekai limit with Documentation

Proposed: Overcoming a V-Sekai limit with Documentation

Metadata

  • Status: Proposed
  • Deciders: V-Sekai
  • Tags: V-Sekai

The Backdrop

The Challenge

The Strategy

GoCD Agent Setup and Automatic Startup on Boot for macOS

Here's a step-by-step guide to setting up a GoCD agent service and configuring it to automatically start up on boot on a Mac.

Initial System Boot and Account Setup

  1. Boot your freshly reset or newly bought Mac.
  2. Proceed with the initial setup, creating a user account as prompted by the macOS setup wizard.

Preparing GoCD Agent

# Navigate to the GoCD agent directory (assuming "go-agent-20.5.0" is the version you have).
cd go-agent-20.5.0

# Remove quarantine attribute from all files in the directory.
sudo xattr -d -r com.apple.quarantine .

Single Sign-On Handling

  1. If necessary, handle Single Sign-On (SSO) to ease into further installations.

Xcode Installation

  1. Log in with your Apple ID to download Xcode from the App Store if required for development.

Installing Homebrew and Command Line Tools

  1. Install Homebrew, the macOS package manager, which will also install the command line developer tools.

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Installing GoCD Agent

  1. Install the GoCD agent using Homebrew or by downloading it directly from the GoCD website.

    # Example using Homebrew
    brew install go-agent

Configuring GoCD Agent

  1. Configure the GoCD agent by editing the wrapper-properties.conf file.

    # Use your favourite text editor to modify the wrapper-properties.conf file.
    open -e ./wrapper-config/wrapper-properties.conf
    
    # Inside the file, set the GoCD server URL and other configurations as needed.

Change GoCD Agent Server URL

  1. Update the GoCD agent server URL in the configuration file to https://ci.v-sekai.cloud/go.

    # Example entry within wrapper-properties.conf
    wrapper.app.parameter.100=-Dgocd.agent.server.url=https://ci.v-sekai.cloud/go

Automating Startup

  1. To automate the GoCD agent startup on boot, create a launch daemon:

    sudo tee /Library/LaunchDaemons/com.gocd.agent.plist <<EOF
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>Label</key>
        <string>com.gocd.agent</string>
        <key>ProgramArguments</key>
        <array>
            <string>/Users/fire/Documents/go-agent-23.5.0/bin/go-agent</string>
            <string>start</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>KeepAlive</key>
        <true/>
    </dict>
    </plist>
    EOF

    Replace /Users/fire/Documents/go-agent-23.5.0 with the actual absolute path of the go-agent binary within your system.

  2. Load the newly created com.gocd.agent.plist to register it with launch services:

    sudo launchctl load /Library/LaunchDaemons/com.gocd.agent.plist
  3. Verify that the agent starts on boot:

    sudo launchctl list | grep com.gocd.agent

Your GoCD agent is now configured to automatically start up as a daemon whenever your Mac boots up.

The Upside

The Downside

The Road Not Taken

The Infrequent Use Case

In Core and Done by Us?

Further Reading

  1. V-Sekai · GitHub - Official GitHub account for the V-Sekai development community focusing on social VR functionality for the Godot Engine
  2. V-Sekai/v-sekai-game - GitHub page for the V-Sekai open-source project bringing social VR/VRSNS/metaverse components to the Godot Engine

AI assistant Aria assisted with this article.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment