Skip to content

Commit

Permalink
Starts an overview lab
Browse files Browse the repository at this point in the history
TL;DR
-----

Provides a stub for a new overview-style lab

Details
-------

Implements a stub track for "Meeting the Replicated Platform", a new lab
that vendors can use to discover the Replicated Platform. The lab will
cover some of the same steps as an overview demo to familiarize vendors
with the Platform on their own.
  • Loading branch information
crdant committed Sep 17, 2024
1 parent 21c98e7 commit 7257a5f
Show file tree
Hide file tree
Showing 10 changed files with 864 additions and 0 deletions.
36 changes: 36 additions & 0 deletions instruqt/meet-the-platform/01-accessing-the-platform/assignment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
slug: accessing-the-platform
id: umt7hoxqedg2
type: challenge
title: The Replicated Platform
teaser: Learn abot and connect to the Replicated Platform
notes:
- type: text
contents: |
The Replicated Platform supports your team throughout the [Commercial
Software Distribution
Lifecycle](https://youtu.be/FtcnUKQuteU?feature=shared). Your primary
interface to the Platform is the Replicated Vendor Portal. This lab
will introduce you to the Platform and show you how to access the Vendor
Portal.
tabs:
- id: kp9tdilwjwt0
title: Shell
type: terminal
hostname: shell
difficulty: basic
timelimit: 600
---

The Replicated Platform is a unified platform bringing together everything you
need to navigate your Commercial Software Distribution Lifecycle. You use the
platform to efficiently manage, test, install, support, and measure the
distribution of your app. The Replicated Vendor Portal provides the interfaces
you need to work with the Platform from the web, the command-line, and
anywhere you can invoke its APIs.

This lab will introduce you to the Replicated Platform through the Vendor
Portal. After getting to know the Vendor Portal, you'll take the role of the
customers and install [SlackerNews](https://slackernews.io), an application
distributed with Replicated. From there, we'll show you how you'll work with
customers having a support issue, and how they'll install a fix.
11 changes: 11 additions & 0 deletions instruqt/meet-the-platform/01-accessing-the-platform/check-shell
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
#
# This script runs when the platform check the challenge.
#
# The platform determines if the script was successful using the exit code of this
# script. If the exit code is not 0, the script fails.
#

echo "This is the check script"

exit 0
11 changes: 11 additions & 0 deletions instruqt/meet-the-platform/01-accessing-the-platform/cleanup-shell
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
#
# This script runs when the platform cleanup the challenge.
#
# The platform determines if the script was successful using the exit code of this
# script. If the exit code is not 0, the script fails.
#

echo "This is the cleanup script"

exit 0
11 changes: 11 additions & 0 deletions instruqt/meet-the-platform/01-accessing-the-platform/setup-shell
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
#
# This script runs when the platform setup the challenge.
#
# The platform determines if the script was successful using the exit code of this
# script. If the exit code is not 0, the script fails.
#

echo "This is the setup script"

exit 0
11 changes: 11 additions & 0 deletions instruqt/meet-the-platform/01-accessing-the-platform/solve-shell
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
#
# This script runs when the platform solve the challenge.
#
# The platform determines if the script was successful using the exit code of this
# script. If the exit code is not 0, the script fails.
#

echo "This is the solve script"

exit 0
14 changes: 14 additions & 0 deletions instruqt/meet-the-platform/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: "3"
containers:
- name: shell
image: gcr.io/kots-field-labs/shell:main
shell: tmux new-session -A -s shell su - replicant
virtualmachines:
- name: node
image: kots-field-labs/future-node
shell: /bin/bash
machine_type: n2d-standard-4
allow_external_ingress:
- http
- https
- high-ports
43 changes: 43 additions & 0 deletions instruqt/meet-the-platform/track.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
slug: meet-the-platform
id: bocfnxay34uj
title: Meet the Replicated Platform
teaser: |-
A template track for sharing the shell environment across
challenges
description: |-
This track is a template track to build any lab that requires
maintaining the shell and it's environment between challenges.
To use it, run:
```
instruqt track create --title [NEW TRACK TITLE] \
--from shared-env-template
```
The track provides both a shell and a single-node cluster, and
the learner runs their commands as the user `replicant`.
Another advantage of this template is that you can check what
the learner has typed into their shell by capturing the `tmux`
pane content and running a grep against it, see the sample
check script in the first challenge for an example.
icon: https://storage.googleapis.com/instruqt-frontend/img/tracks/default.png
tags:
- template
owner: replicated
developers:
- chuck@replicated.com
maintenance: true
idle_timeout: 300
timelimit: 1200
lab_config:
overlay: false
width: 25
position: right
sidebar_enabled: true
feedback_recap_enabled: true
feedback_tab_enabled: false
loadingMessages: true
hideStopButton: false
checksum: "11533550873014008068"
36 changes: 36 additions & 0 deletions instruqt/meet-the-platform/track_scripts/setup-node
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash

# This set line ensures that all failures will cause the script to error and exit
set -euxo pipefail

# simple SSH client setup so we can SSH to/from the shell

cat <<EOF >> "$HOME/.ssh/config"
Host *
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
PubkeyAcceptedKeyTypes +ssh-rsa
EOF

while ! ssh shell true; do
echo "Waiting for container SSH to be available..."
sleep 1
done

# use our shared libary in setup scripts
curl -s -o /etc/profile.d/header.sh https://raw.githubusercontent.com/replicatedhq/replicated-field-labs/main/libs/header.sh
source /etc/profile.d/header.sh

api_token=$(get_api_token)
app_slug=$(get_app_slug)
app_id=$(get_app_id)
replicated_sdk_version=$(get_replicated_sdk_version)
embedded_cluster_version=$(get_embedded_cluster_version)

agent variable set USERNAME $(get_username)
agent variable set PASSWORD $(get_password)
agent variable set SLACKERNEWS_DOMAIN $(get_slackernews_domain)
agent variable set REPLICATED_API_TOKEN ${api_token}
agent variable set REPLICATED_APP ${app_slug}
agent variable set REPLICATED_SDK_VERSION ${replicated_sdk_version}
agent variable set EMBEDDED_CLUSTER_VERSION ${embedded_cluster_version}
Loading

0 comments on commit 7257a5f

Please sign in to comment.