27 Commits

Author SHA1 Message Date
Manuel Alejandro de Brito Fontes
d13f3b2fc3 Update services node pool labels 2023-01-18 20:16:26 +01:00
Christian Weichel
478a75e744 Switch license to AGPL 2022-12-08 13:05:19 -03:00
Tarun Pothulapati
f245a4712d [local-preview] Update status messages to depend on echo'sh
With the removal of `-x` option in bash, We can't rely on the
commands anymore and instead have to start using `echo` messages
to match statuses in `prettylog`.

This PR updates the remaining statuses on the
same.

Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
2022-11-03 11:40:07 +01:00
Manuel Alejandro de Brito Fontes
d5eb5815b5 Update to 1.19 2022-10-04 15:17:22 +02:00
Christian Weichel
174a09222f Revert "Run go work sync"
This reverts commit 6b23167e09f74062b31150d4044a8fe7cacbc34b.
2022-09-29 05:28:29 +02:00
Tarun Pothulapati
ca474492cf [local-preview] Failure with more specific information
Currently, When there is a failure at `checking_prerequisites` we
don't actually propogate the issue resulting in confusion to the users.
This PR updates the prettylog script to propogate the same
as an error for the user to get more information

Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
2022-09-28 14:54:28 +02:00
Christian Weichel
6b23167e09 Run go work sync 2022-09-28 08:45:28 +02:00
Mads Hartmann
3c7c79b788 Use a normal component and conditionally build it using leeway build 2022-09-27 15:43:27 +02:00
Tarun Pothulapati
b767c6ec6c [local-preview] Warn and Confirm from user before proceeding
Currently, For Users with ARM CPU's, `local-preview` does not
really work and its hard for the script to know as it runs inside
docker (which could be a x86 VM).

This Updates the script to warn the users on the requirements before
starting and running `local-preview`.

Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
2022-09-23 13:56:24 +02:00
Mads Hartmann
e1985ce735 Add withLocalPreview 2022-09-21 18:07:22 +02:00
Tarun Pothulapati
c8eedd0659 [local-preview] Reduce storage requirements
This PR reduces the storage requests across PVC's and workspaces

Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
2022-09-13 09:33:14 +02:00
Tarun Pothulapati
470c1eb376 [local-preview] Remove unused dead code
This PR removes the unnecessary dead code in the
`entrypoint.sh` that isn't actually useful anymore,
or become stale.

Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>

update k3s image

Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
2022-09-07 11:49:22 +02:00
Tarun Pothulapati
774a5e2831 [local-preview] set low memory requirements
Updates `ws-daemon` and `minio` to use `250Mi`
of memory and thus being low, instead of their
current high's of 4Gi and 2Gi respectively.

Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
2022-09-06 07:45:21 +02:00
Tarun Pothulapati
d286397e9f [local-preview] Fail if M1 Mac
Currently, If its a M1 Mac, The local preview instance
just continues running as the failures are in k3s. We
should instead fail earlier so that the user understands
the problem.

We already have a warning for the same in the documentation
website, but having a check seems to be useful.

Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
2022-08-29 14:02:13 +02:00
Manuel Alejandro de Brito Fontes
7b4a885ee3 Update k8s dependencies to v0.24.3 2022-08-23 08:18:39 +02:00
Tarun Pothulapati
601fe91b57 [dashboard] Next steps nudge for local-preview
Currently, After `local-preview` is exited There are no
direct concrete steps for users to take.

This PR fixes this by adding a new `Alert` box to the
global dashboard if we notice that they are on a Gitpod
`local-preview` DOMAIN, which is `preview.gitpod-self-hosted.com`
(our own DOMAIN) from now.

Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
2022-08-02 08:48:46 -03:00
Tarun Pothulapati
62f576f12c [local-preview] Send telemetry for each event
Currently, The telemetry of `local-preview` is the same as any self-hosted install which
means that these telemetry cronjob is run daily, and also once when the installation is ready.
This information isn't as useful, as the properties aren't that important for a short-lived
installation.

Instead, It would make sense to have telemetry on each event of the `local-preview`
command itself so that we can measure the Installation success rate,  Time taken, etc
to improve the overall UX of `local-preview`. This will be more important for us
to understand the usage of `local-preview` itself.

This PR fixes that by attaching a telemetry event to be sent, for each status update
in `local-preview`. For this to work, A anonymous User ID is generated and used
for all status updates.

Event Schema:

```
analytics.track({
    userId: userId,
    event: "localpreview_status",
    properties: {
        status: "checking prerequisites" | "starting gitpod" | "gitpod ready"
    }
})
```

Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
2022-07-29 03:23:23 -03:00
Tarun Pothulapati
af9da1c7da [local-preview] Remove cert-manager dependency
This PR removes the dependency of `cert-manager` and thus
reducing resource usage. This is replaced by the usage of
`mkcert` instead

Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
2022-07-21 05:19:16 -03:00
Tarun Pothulapati
63e4b0f468 [local-preview] honour DO_NOT_TRACK env variable
Currently, There is no way to disable telemetry for `local-preview`
as we run the cronjob manaully during init, when Gitpod is ready.

This fixes that by honouring [`DO_NOT_TRACK` envrionment variable](https://consoledonottrack.com/)
, which when set prevent the script from triggering the cronjob manually.

Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
2022-07-20 08:00:15 -03:00
Tarun Pothulapati
eefee5515a [local-preview] show DOMAIN in the output
This PR updates the `local-preview` to printout
the Domain of the Gitpod Instance for users to
access.

Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
2022-07-13 16:43:00 +02:00
Tarun Pothulapati
a65c946432 [local-preview] Support 127-0-0-1.nip.io for DOMAIN
Due to the way docker works in non-native platforms, It is
very hard to have a consistent experience across all platforms
as we can't just use the [docker bridge netwrok IP's in non-native
platforms](https://docs.docker.com/desktop/networking/). This means that
users have to search their Host IP, and use It
to get up and working [which we tried, but understand that it's not
a good UX](https://github.com/gitpod-io/website/pull/2349).

But users can use `127-0-0-1.nip.io` as the DOMAIN which resolves to
 `127.0.0.1` and is available in all platforms as its `localhost`. This
works well and good for all user communication
but internal communication fails as `127-0-0-1.nip.io` for them
is something else.

So, This PR fixes that by adding new coredns
`gitpod.db` coredns config essentially asking to route all
`127-0-0-1.nip.io` to `proxy.default.svc.cluster.local`. [As k3s does
not yet support overriding coredns config in a sane-way](https://github.com/k3s-io/k3s/issues/462)
,We instead skip the default coredns by adding `coredns.yaml.skip` file,
and adding our own `custom-coredns.yaml` which is just plain
`coredns.yaml` that comes with `k3s`, added with gitpod config.

Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
2022-07-12 04:07:58 +05:30
Tarun Pothulapati
7e31087f7b [local-preview] Differentiate btw Gitpod starting and running
Currently, It takes a while before Gitpod is ready even though
the status says `Gitpod is running` as its not checking for
readyness.

This PR updates the output to separate btw `starting` and `running`.
`Gitpod is running` message is showed only when we see that
the `gitpod-telemetry-init` job has run which happens when
all pods are ready.

Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
2022-07-11 13:40:58 +05:30
Tarun Pothulapati
79f73129fa [preview] run the telemetry job right after gitpod is ready
This PR updates the `entry-point.sh` to run a parallel step
that waits for the gitpod pods to be ready, and manually executes
the cronjob once its necessary.

This is necessary as our telemetry `cronjobs` are only ran
daily in the midnight, and we can't expect this schedule to work
for local previews as they are short lived.

example data that we get:

```
client.Track(&analytics.Track{
  UserId: "334c379a-afee-4882-ba44-fbd7dfc0a8b0",
  Event: "Installation telemetry",
  Properties: map[string]interface{}{
    "customerID": "",
    "platform": "local-preview",
    "totalInstances": 0,
    "totalUsers": 0,
    "totalWorkspaces": 0,
    "version": "tar-preview-tel-init.4",
  },
})
```

Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
2022-07-05 14:13:52 +05:30
Tarun Pothulapati
c96adbed6d [telemetry] Add new telemetry.data config option for telemetry
Fixes https://github.com/gitpod-io/gitpod/issues/10766

This PR adds a new `experimental.telemetry.data.platform` config option
that is then passed to `GITPOD_INSTALLATION_PLATFORM` env variable, which
is then transmitted by the `gitpod-telemetry` job as the `platform`
property into our telemetry store. The value of this env variable
is then overrided by each install method.

This env can have the following values:
- `installer` by default as when the installation is done directly
  through the installer, We don't have enough information
   about the environment.
-  [One of the `distribution` values](https://docs.replicated.com/reference/template-functions-static-context#distribution)
   when done through `kots`. This would have the distribution in which
   Gitpod is being installed, and is dependent on `kots`.
- `local-preview` when the installation is done through the new
   preview install method.

As the changes show in the PR, each installation method overrides
the value.

Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
2022-07-01 14:53:40 +05:30
Tarun Pothulapati
5800e3ce63 [preview] rename preview-install to local-preview
This PR updates the new preview installation method, to be
called `local-preview`. This is part of the recent change
across the documentation https://github.com/gitpod-io/website/pull/2326

The image tag is still `preview-install` in the readme's and other
documentations, but it will be updated once we start publishing
releases with it.

Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
2022-06-30 17:02:38 +05:30
Tarun Pothulapati
12d4b3931a [preview-install] Add user-friendly output
Part of https://github.com/gitpod-io/gitpod/issues/9075

This PR adds user friendly output to the preview install
docker container by adding a new program prettylog that
looks at the output of the entry-point.sh and just adds status
updates and spinners.

This feels easier instead of adding the same status updates in
bash.

The status updates are also kept as simple as possible and
any additional instructions (URL, and certs) will be added
to the documentation instead of here. Feel free to post here
if you think it would be better to have them here in the
script.

Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
2022-06-17 18:47:26 +05:30
Tarun Pothulapati
6b387debb5 [self-hosted] Gitpod local preview install method
Fixes https://github.com/gitpod-io/gitpod/issues/9075

This PR adds a new install method called `preview` under the
`install` directory. This includes a sh script i.e `entrypoint.sh`
that gets loaded into a docker container in the `Dockerfile`.

This `entrypoint.sh` does the following:
- Checks for minimum system requirements
- Generates a root certificate using `mkcerts`, and loads into the
  host's `/tmp/gitpod/gitpod-ca.crt`.
- Renders `cert-manager` resources, self-signed Gitpod into
  `/var/lib/rancher/k3s/server/manifests`.
- Initialises `k3s` inside the container.

Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
2022-06-15 21:44:25 +05:30