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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>