Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starts an overview lab #350

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
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
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
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
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
Loading