From 87e3291dd5aef58c8378fa7893df09452ba42282 Mon Sep 17 00:00:00 2001 From: Robert Stringer Date: Thu, 11 Mar 2021 21:23:28 +0000 Subject: [PATCH 01/15] demo: first commit Former-commit-id: 9787c1b97c15d569becfd76830829a9fa86cbe81 --- advocacy_docs/playground/demo/index.mdx | 99 +++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 advocacy_docs/playground/demo/index.mdx diff --git a/advocacy_docs/playground/demo/index.mdx b/advocacy_docs/playground/demo/index.mdx new file mode 100644 index 00000000000..d96283c02d1 --- /dev/null +++ b/advocacy_docs/playground/demo/index.mdx @@ -0,0 +1,99 @@ +--- +title: "PostgreSQL for Beginners: Benchmarking PostgreSQL" +description: "Showing the fine folks at EDB what happens behind the scenes of a Docs 2.0 tutorial." +navTitle: "Benchmarking PostgreSQL" +iconName: postgresql + +# Configuration options for Katacoda +platform: ubuntu +katacodaPanel: + scenario: ubuntu:2004 + initializeCommand: wget -q https://raw.githubusercontent.com/josh-heyer/barmantutorial/main/step01-db-setup/docker-compose.yaml ; docker-compose up -d ; clear ; docker exec -it -u postgres pg /bin/bash + codelanguages: shell, sql, ini +--- + +Let say I'm working on a blog article, and I want to explain with the help of an interactive environment, just how to go about doing something like enabling timing. + +When you click "Start Now," Katacoda will load a Docker Compose environment with two container images representing a +PostgreSQL 13 server with [the Pagila database](https://github.com/devrimgunduz/pagila) loaded (named `pg`). + +Once you see a `postgres@pg` prompt, you can follow the steps below. + +!!! "" +This tutorial is currently piggybacking another tutorial's config. This is for demo purposes only. +!!! + + + +There's a database up and running, so lets interact with it: + +```shell +psql -d pagila +``` + +Is there anything good in here? + +```sql +\dt +__OUTPUT__ + List of relations + Schema | Name | Type | Owner +--------+------------------+-------------------+---------- + public | actor | table | postgres + public | address | table | postgres + public | category | table | postgres + public | city | table | postgres + public | country | table | postgres + public | customer | table | postgres + public | film | table | postgres + public | film_actor | table | postgres + public | film_category | table | postgres + public | inventory | table | postgres + public | language | table | postgres + public | payment | partitioned table | postgres + public | payment_p2020_01 | table | postgres + public | payment_p2020_02 | table | postgres + public | payment_p2020_03 | table | postgres + public | payment_p2020_04 | table | postgres + public | payment_p2020_05 | table | postgres + public | payment_p2020_06 | table | postgres + public | rental | table | postgres + public | staff | table | postgres + public | store | table | postgres +(21 rows) +``` + +Lets see how many actors there are in our database: +```sql +select * from actor; +``` + + +Hmm, I don't know how long that took. Also, I don't want to page all the results when I can scroll. + +Lets enable `Timing` and turn off `pager`, so we can see how quickly our queries ran: + +```sql +\timing on +\pset pager off +``` + +Now we should get a timing when we rerun our query: + +```sql +select * from actor; +__OUTPUT__ +(200 rows) + +Time: 0.699 ms +``` + +Now lets see how many films are in our database and how long the query takes to execute: + +```sql +select * from film; +__OUTPUT__ +(1000 rows) + +Time: 10.289 ms +``` \ No newline at end of file From ea62f06e2ba824b0aeb62b601b53fb95bcba2b27 Mon Sep 17 00:00:00 2001 From: Robert Stringer Date: Fri, 12 Mar 2021 13:20:59 +0000 Subject: [PATCH 02/15] wanting to share progress Former-commit-id: 95a61254ab67bf91e8cb4892f4ccd8f72c5d2815 --- advocacy_docs/playground/demo/index.mdx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/advocacy_docs/playground/demo/index.mdx b/advocacy_docs/playground/demo/index.mdx index d96283c02d1..8385fcdd3c8 100644 --- a/advocacy_docs/playground/demo/index.mdx +++ b/advocacy_docs/playground/demo/index.mdx @@ -14,15 +14,16 @@ katacodaPanel: Let say I'm working on a blog article, and I want to explain with the help of an interactive environment, just how to go about doing something like enabling timing. +This is a new paragraph. Hopefully the site updates to show it. + +This is a new paragraph. Hopefully the site updates to show it. + When you click "Start Now," Katacoda will load a Docker Compose environment with two container images representing a PostgreSQL 13 server with [the Pagila database](https://github.com/devrimgunduz/pagila) loaded (named `pg`). Once you see a `postgres@pg` prompt, you can follow the steps below. -!!! "" -This tutorial is currently piggybacking another tutorial's config. This is for demo purposes only. -!!! - + There's a database up and running, so lets interact with it: From ca5b12dfea859f8709824c31f24bde7cc63cd8a0 Mon Sep 17 00:00:00 2001 From: Josh Heyer <63653723+josh-heyer@users.noreply.github.com> Date: Sun, 14 Mar 2021 22:21:56 -0600 Subject: [PATCH 03/15] Remove mention of config/pull sources These are now optional / unusual Former-commit-id: b279e05397bc08fb54acd8d0dde78b7395d89e36 --- README_DOCKER_VSCODE.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README_DOCKER_VSCODE.md b/README_DOCKER_VSCODE.md index 6f751f0fd61..ff4a6813bda 100644 --- a/README_DOCKER_VSCODE.md +++ b/README_DOCKER_VSCODE.md @@ -1,6 +1,6 @@ # Working on Docs in a Docker container using VSCode -If you cannot or do not wish to install the prerequisite versions of Python, Node, Yarn, Gatsby, etc. on your local machine, *and* you're fond of using VSCode, then you can skip past the first seven steps under the "installation" section in the [README](README.md) and work with Docs entirely from within a Docker container managed by VSCode. +If you cannot or do not wish to install the prerequisite versions of Python, Node, Yarn, Gatsby, etc. on your local machine, *and* you're fond of using VSCode, then you can skip past the first eleven steps under the "installation" section in the [README](README.md) and work with Docs entirely from within a Docker container managed by VSCode. ## Prerequesites @@ -16,9 +16,7 @@ If you intend to edit using VSCode, I also recommend installing the [MDX extensi 2. Paste in the URL of this repository, or a GitHub branch URL, or a GitHub PR URL 3. Choose "isolated volume" (in most cases this will be what you want) 4. Wait for VSCode to build the container, then open a terminal -8. Select sources with `yarn config-sources` (see [README](README.md) for details) -9. Pull sources with `yarn pull-sources` (see [README](README.md) for details) -10. Run the site locally with `yarn develop`. VSCode will remap port 8000 used within the container to a free port on your machine, which you can view from the Remote Explorer panel in the left sidebar - or ctrl+click the URL that Gatsby prints in the terminal to open directly. +8. Run the site locally with `yarn develop`. VSCode will remap port 8000 used within the container to a free port on your machine, which you can view from the Remote Explorer panel in the left sidebar - or ctrl+click the URL that Gatsby prints in the terminal to open directly. You can create as many distinct containers and volumes as you wish, which can be handy for comparing PRs side-by-side without disturbing your primary work. To browse them (or clean them up) open the "Remote Explorer" tool in VSCode. From 546b04e41da1b10e3cd9d78118661c723c4112cb Mon Sep 17 00:00:00 2001 From: "Nisha.Shah" Date: Mon, 15 Mar 2021 16:22:29 +0530 Subject: [PATCH 04/15] updated the title supported versions in the index Former-commit-id: b9380966ce381468e78404b0402efb33c0adfb90 --- .../docs/migration_portal/3.0.1/02_supported_platforms.mdx | 2 +- product_docs/docs/migration_portal/3.0.1/index.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/product_docs/docs/migration_portal/3.0.1/02_supported_platforms.mdx b/product_docs/docs/migration_portal/3.0.1/02_supported_platforms.mdx index 255f267a80a..5894cfeddae 100644 --- a/product_docs/docs/migration_portal/3.0.1/02_supported_platforms.mdx +++ b/product_docs/docs/migration_portal/3.0.1/02_supported_platforms.mdx @@ -2,7 +2,7 @@ title: "Supported Platforms" --- - + The Migration Portal supports assessment and migration from Oracle 11g and 12c to EDB Postgres Advanced Server 10, 11, 12, 0r 13. Migration Portal is supported on the following browsers and operating systems: diff --git a/product_docs/docs/migration_portal/3.0.1/index.mdx b/product_docs/docs/migration_portal/3.0.1/index.mdx index 6b3980eb645..bbc86ecd961 100644 --- a/product_docs/docs/migration_portal/3.0.1/index.mdx +++ b/product_docs/docs/migration_portal/3.0.1/index.mdx @@ -16,6 +16,6 @@ EnterpriseDB has helped companies migrate their existing database systems to Pos
-whats_new supported_versions mp_using_portal mp_migrating_database mp_advanced_data_migration conclusion +supported_platforms mp_using_portal mp_migrating_database mp_advanced_data_migration
From ba3876a6f0ef379331b07aebe5681206d59f9ed3 Mon Sep 17 00:00:00 2001 From: josh-heyer Date: Mon, 15 Mar 2021 11:38:07 +0000 Subject: [PATCH 05/15] New PDFs generated by Github Actions Former-commit-id: 6adda8aa9e37beb5a56200e266fa54d2f65ea1fd From 735363f2edd0092fd332818f845f06a026277920 Mon Sep 17 00:00:00 2001 From: Robert Stringer <62722976+cero-miedo@users.noreply.github.com> Date: Mon, 15 Mar 2021 12:11:25 +0000 Subject: [PATCH 06/15] Update 02_supported_platforms.mdx Former-commit-id: 375493dc013455362746745a2617b3153db2807d --- .../docs/migration_portal/3.0.1/02_supported_platforms.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product_docs/docs/migration_portal/3.0.1/02_supported_platforms.mdx b/product_docs/docs/migration_portal/3.0.1/02_supported_platforms.mdx index 8488eb14428..1e4c9e46efa 100644 --- a/product_docs/docs/migration_portal/3.0.1/02_supported_platforms.mdx +++ b/product_docs/docs/migration_portal/3.0.1/02_supported_platforms.mdx @@ -1,5 +1,5 @@ --- -title: "Supported Versions" +title: "Supported Platforms" legacyRedirectsGenerated: # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. From 3e62c352762c2313d618afeb9c57525edf4c4a39 Mon Sep 17 00:00:00 2001 From: josh-heyer Date: Mon, 15 Mar 2021 12:20:03 +0000 Subject: [PATCH 07/15] New PDFs generated by Github Actions Former-commit-id: 8b8a94a9ae9fbae690db4fb2b875e6f19f67bef3 From 870e197bc15af18b1074b9ac60dc18875b3baa9c Mon Sep 17 00:00:00 2001 From: Robert Stringer Date: Mon, 15 Mar 2021 12:27:20 +0000 Subject: [PATCH 08/15] Bringing #1065 into Develop Former-commit-id: 6ca070bd8f92e73a360638674b40e22898740e06 --- .../pem/8.0.1/pem_online_help/11_appendices/02_kerberos.mdx | 2 +- .../docs/pem/8.0/pem_online_help/11_appendices/02_kerberos.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/product_docs/docs/pem/8.0.1/pem_online_help/11_appendices/02_kerberos.mdx b/product_docs/docs/pem/8.0.1/pem_online_help/11_appendices/02_kerberos.mdx index dfb82df61ed..3cd61dabfaf 100644 --- a/product_docs/docs/pem/8.0.1/pem_online_help/11_appendices/02_kerberos.mdx +++ b/product_docs/docs/pem/8.0.1/pem_online_help/11_appendices/02_kerberos.mdx @@ -4,7 +4,7 @@ title: "The MIT Kerberos Licence" -PostgreSQL Enterprise Manager uses PostgreSQL's libpq library which may be linked with MIT Kerberos Libraries on some distributions. The MIT Kerberos licence is included below: +Postgres Enterprise Manager uses PostgreSQL's libpq library which may be linked with MIT Kerberos Libraries on some distributions. The MIT Kerberos licence is included below: ## Kerberos Copyright diff --git a/product_docs/docs/pem/8.0/pem_online_help/11_appendices/02_kerberos.mdx b/product_docs/docs/pem/8.0/pem_online_help/11_appendices/02_kerberos.mdx index 213b6ca4845..381d0c9b3fc 100644 --- a/product_docs/docs/pem/8.0/pem_online_help/11_appendices/02_kerberos.mdx +++ b/product_docs/docs/pem/8.0/pem_online_help/11_appendices/02_kerberos.mdx @@ -8,7 +8,7 @@ legacyRedirectsGenerated: -PostgreSQL Enterprise Manager uses PostgreSQL's libpq library which may be linked with MIT Kerberos Libraries on some distributions. The MIT Kerberos licence is included below: +Postgres Enterprise Manager uses PostgreSQL's libpq library which may be linked with MIT Kerberos Libraries on some distributions. The MIT Kerberos licence is included below: ## Kerberos Copyright From db05256219fe9fab639e1b3df71c06f32ce384eb Mon Sep 17 00:00:00 2001 From: Robert Stringer Date: Mon, 15 Mar 2021 12:36:16 +0000 Subject: [PATCH 09/15] Revert "wanting to share progress" This reverts commit ea62f06e2ba824b0aeb62b601b53fb95bcba2b27 [formerly 95a61254ab67bf91e8cb4892f4ccd8f72c5d2815]. Former-commit-id: 5d8d8b5249fc7fa88ac941ca8d6a9c4a56ccc118 --- advocacy_docs/playground/demo/index.mdx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/advocacy_docs/playground/demo/index.mdx b/advocacy_docs/playground/demo/index.mdx index 8385fcdd3c8..d96283c02d1 100644 --- a/advocacy_docs/playground/demo/index.mdx +++ b/advocacy_docs/playground/demo/index.mdx @@ -14,16 +14,15 @@ katacodaPanel: Let say I'm working on a blog article, and I want to explain with the help of an interactive environment, just how to go about doing something like enabling timing. -This is a new paragraph. Hopefully the site updates to show it. - -This is a new paragraph. Hopefully the site updates to show it. - When you click "Start Now," Katacoda will load a Docker Compose environment with two container images representing a PostgreSQL 13 server with [the Pagila database](https://github.com/devrimgunduz/pagila) loaded (named `pg`). Once you see a `postgres@pg` prompt, you can follow the steps below. - +!!! "" +This tutorial is currently piggybacking another tutorial's config. This is for demo purposes only. +!!! + There's a database up and running, so lets interact with it: From 788d96be2341ef025fb7b61fe8fbbc21a09c40a2 Mon Sep 17 00:00:00 2001 From: Robert Stringer Date: Mon, 15 Mar 2021 14:53:33 +0000 Subject: [PATCH 10/15] Revert "demo: first commit" This reverts commit 87e3291dd5aef58c8378fa7893df09452ba42282 [formerly 9787c1b97c15d569becfd76830829a9fa86cbe81]. Former-commit-id: 94692fa71c1ce4646a8f433d72bb1260c5f12292 --- advocacy_docs/playground/demo/index.mdx | 99 ------------------------- 1 file changed, 99 deletions(-) delete mode 100644 advocacy_docs/playground/demo/index.mdx diff --git a/advocacy_docs/playground/demo/index.mdx b/advocacy_docs/playground/demo/index.mdx deleted file mode 100644 index d96283c02d1..00000000000 --- a/advocacy_docs/playground/demo/index.mdx +++ /dev/null @@ -1,99 +0,0 @@ ---- -title: "PostgreSQL for Beginners: Benchmarking PostgreSQL" -description: "Showing the fine folks at EDB what happens behind the scenes of a Docs 2.0 tutorial." -navTitle: "Benchmarking PostgreSQL" -iconName: postgresql - -# Configuration options for Katacoda -platform: ubuntu -katacodaPanel: - scenario: ubuntu:2004 - initializeCommand: wget -q https://raw.githubusercontent.com/josh-heyer/barmantutorial/main/step01-db-setup/docker-compose.yaml ; docker-compose up -d ; clear ; docker exec -it -u postgres pg /bin/bash - codelanguages: shell, sql, ini ---- - -Let say I'm working on a blog article, and I want to explain with the help of an interactive environment, just how to go about doing something like enabling timing. - -When you click "Start Now," Katacoda will load a Docker Compose environment with two container images representing a -PostgreSQL 13 server with [the Pagila database](https://github.com/devrimgunduz/pagila) loaded (named `pg`). - -Once you see a `postgres@pg` prompt, you can follow the steps below. - -!!! "" -This tutorial is currently piggybacking another tutorial's config. This is for demo purposes only. -!!! - - - -There's a database up and running, so lets interact with it: - -```shell -psql -d pagila -``` - -Is there anything good in here? - -```sql -\dt -__OUTPUT__ - List of relations - Schema | Name | Type | Owner ---------+------------------+-------------------+---------- - public | actor | table | postgres - public | address | table | postgres - public | category | table | postgres - public | city | table | postgres - public | country | table | postgres - public | customer | table | postgres - public | film | table | postgres - public | film_actor | table | postgres - public | film_category | table | postgres - public | inventory | table | postgres - public | language | table | postgres - public | payment | partitioned table | postgres - public | payment_p2020_01 | table | postgres - public | payment_p2020_02 | table | postgres - public | payment_p2020_03 | table | postgres - public | payment_p2020_04 | table | postgres - public | payment_p2020_05 | table | postgres - public | payment_p2020_06 | table | postgres - public | rental | table | postgres - public | staff | table | postgres - public | store | table | postgres -(21 rows) -``` - -Lets see how many actors there are in our database: -```sql -select * from actor; -``` - - -Hmm, I don't know how long that took. Also, I don't want to page all the results when I can scroll. - -Lets enable `Timing` and turn off `pager`, so we can see how quickly our queries ran: - -```sql -\timing on -\pset pager off -``` - -Now we should get a timing when we rerun our query: - -```sql -select * from actor; -__OUTPUT__ -(200 rows) - -Time: 0.699 ms -``` - -Now lets see how many films are in our database and how long the query takes to execute: - -```sql -select * from film; -__OUTPUT__ -(1000 rows) - -Time: 10.289 ms -``` \ No newline at end of file From efba4bce97fe8eb65389368f69c8c3b58fcf2f3a Mon Sep 17 00:00:00 2001 From: josh-heyer Date: Mon, 15 Mar 2021 15:02:40 +0000 Subject: [PATCH 11/15] New PDFs generated by Github Actions Former-commit-id: a2e90c0e6287001da7c8ab28a8d10b71c9c2526f From 7dc426715ae4e8b16f3c03c9b255b5dfbebf6cfa Mon Sep 17 00:00:00 2001 From: Josh Heyer <63653723+josh-heyer@users.noreply.github.com> Date: Mon, 15 Mar 2021 10:39:54 -0700 Subject: [PATCH 12/15] allow using docker from within docker-hosted dev env (#1066) Former-commit-id: 8da46af028e438a1b4f81d9b8ec9ba2ac8cbaf6e --- .devcontainer/Dockerfile | 9 + .devcontainer/devcontainer.json | 4 + .../docker-in-docker-debian.sh | 186 ++++++++++++++++++ 3 files changed, 199 insertions(+) create mode 100644 .devcontainer/library-scripts/docker-in-docker-debian.sh diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index f83d7f8153b..a18485abdbb 100755 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -28,3 +28,12 @@ RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/shar RUN su vscode -c "source /usr/local/share/nvm/nvm.sh \ && npm install -g gatsby-cli \ && npm install -g yarn" 2>&1 + +# Enable docker-in-docker (see: https://github.com/microsoft/vscode-dev-containers/blob/master/script-library/docs/docker-in-docker.md) +COPY library-scripts/*.sh /tmp/library-scripts/ +RUN wget -O- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ + && apt-get update \ + && /bin/bash /tmp/library-scripts/docker-in-docker-debian.sh +ENTRYPOINT ["/usr/local/share/docker-init.sh"] +VOLUME [ "/var/lib/docker" ] +CMD ["sleep", "infinity"] diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 50d43e70df1..0217cb1f24d 100755 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -23,6 +23,10 @@ // Use 'postCreateCommand' to run commands after the container is created. "postCreateCommand": "yarn install && git submodule update --init", + // docker in docker (https://github.com/microsoft/vscode-dev-containers/blob/master/script-library/docs/docker-in-docker.md) + "runArgs": ["--init", "--privileged"], + "overrideCommand": false + // Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root. // "remoteUser": "node" } diff --git a/.devcontainer/library-scripts/docker-in-docker-debian.sh b/.devcontainer/library-scripts/docker-in-docker-debian.sh new file mode 100644 index 00000000000..40c7a695482 --- /dev/null +++ b/.devcontainer/library-scripts/docker-in-docker-debian.sh @@ -0,0 +1,186 @@ +#!/usr/bin/env bash +#------------------------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. +#------------------------------------------------------------------------------------------------------------- +# +# Docs: https://github.com/microsoft/vscode-dev-containers/blob/master/script-library/docs/docker-in-docker.md +# Maintainer: The VS Code and Codespaces Teams +# +# Syntax: ./docker-in-docker-debian.sh [enable non-root docker access flag] [non-root user] [use moby] + +ENABLE_NONROOT_DOCKER=${1:-"true"} +USERNAME=${2:-"automatic"} +USE_MOBY=${3:-"true"} + +set -e + +if [ "$(id -u)" -ne 0 ]; then + echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.' + exit 1 +fi + +# Determine the appropriate non-root user +if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then + USERNAME="" + POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)") + for CURRENT_USER in ${POSSIBLE_USERS[@]}; do + if id -u ${CURRENT_USER} > /dev/null 2>&1; then + USERNAME=${CURRENT_USER} + break + fi + done + if [ "${USERNAME}" = "" ]; then + USERNAME=root + fi +elif [ "${USERNAME}" = "none" ] || ! id -u ${USERNAME} > /dev/null 2>&1; then + USERNAME=root +fi + +# Function to run apt-get if needed +apt-get-update-if-needed() +{ + if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then + echo "Running apt-get update..." + apt-get update + else + echo "Skipping apt-get update." + fi +} + +# Ensure apt is in non-interactive to avoid prompts +export DEBIAN_FRONTEND=noninteractive + +# Install docker/dockerd dependencies if missing +if ! dpkg -s apt-transport-https curl ca-certificates lsb-release lxc pigz iptables > /dev/null 2>&1 || ! type gpg > /dev/null 2>&1; then + apt-get-update-if-needed + apt-get -y install --no-install-recommends apt-transport-https curl ca-certificates lsb-release lxc pigz iptables gnupg2 +fi + +# Swap to legacy iptables for compatibility +update-alternatives --set iptables /usr/sbin/iptables-legacy +update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy + +# Install Docker / Moby CLI if not already installed +if type docker > /dev/null 2>&1 && type dockerd > /dev/null 2>&1; then + echo "Docker / Moby CLI and Engine already installed." +else + if [ "${USE_MOBY}" = "true" ]; then + DISTRO=$(lsb_release -is | tr '[:upper:]' '[:lower:]') + CODENAME=$(lsb_release -cs) + curl -s https://packages.microsoft.com/keys/microsoft.asc | (OUT=$(apt-key add - 2>&1) || echo $OUT) + echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-${DISTRO}-${CODENAME}-prod ${CODENAME} main" > /etc/apt/sources.list.d/microsoft.list + apt-get update + apt-get -y install --no-install-recommends moby-cli moby-engine + else + curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | (OUT=$(apt-key add - 2>&1) || echo $OUT) + echo "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list + apt-get update + apt-get -y install --no-install-recommends docker-ce-cli docker-ce + fi +fi + +echo "Finished installing docker / moby" + +# Install Docker Compose if not already installed +if type docker-compose > /dev/null 2>&1; then + echo "Docker Compose already installed." +else + LATEST_COMPOSE_VERSION=$(curl -sSL "https://api.github.com/repos/docker/compose/releases/latest" | grep -o -P '(?<="tag_name": ").+(?=")') + curl -sSL "https://github.com/docker/compose/releases/download/${LATEST_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose + chmod +x /usr/local/bin/docker-compose +fi + +# If init file already exists, exit +if [ -f "/usr/local/share/docker-init.sh" ]; then + echo "/usr/local/share/docker-init.sh already exists, so exiting." + exit 0 +fi +echo "docker-init doesnt exist..." + +# Add user to the docker group +if [ "${ENABLE_NONROOT_DOCKER}" = "true" ]; then + if ! getent group docker > /dev/null 2>&1; then + groupadd docker + fi + usermod -aG docker ${USERNAME} +fi + +tee /usr/local/share/docker-init.sh > /dev/null \ +<< 'EOF' +#!/usr/bin/env bash +#------------------------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. +#------------------------------------------------------------------------------------------------------------- + +sudoIf() +{ + if [ "$(id -u)" -ne 0 ]; then + sudo "$@" + else + "$@" + fi +} + +# explicitly remove dockerd and containerd PID file to ensure that it can start properly if it was stopped uncleanly +# ie: docker kill +sudoIf find /run /var/run -iname 'docker*.pid' -delete || : +sudoIf find /run /var/run -iname 'container*.pid' -delete || : + +set -e + +## Dind wrapper script from docker team +# Maintained: https://github.com/moby/moby/blob/master/hack/dind + +export container=docker + +if [ -d /sys/kernel/security ] && ! sudoIf mountpoint -q /sys/kernel/security; then + sudoIf mount -t securityfs none /sys/kernel/security || { + echo >&2 'Could not mount /sys/kernel/security.' + echo >&2 'AppArmor detection and --privileged mode might break.' + } +fi + +# Mount /tmp (conditionally) +if ! sudoIf mountpoint -q /tmp; then + sudoIf mount -t tmpfs none /tmp +fi + +# cgroup v2: enable nesting +if [ -f /sys/fs/cgroup/cgroup.controllers ]; then + # move the init process (PID 1) from the root group to the /init group, + # otherwise writing subtree_control fails with EBUSY. + sudoIf mkdir -p /sys/fs/cgroup/init + sudoIf echo 1 > /sys/fs/cgroup/init/cgroup.procs + # enable controllers + sudoIf sed -e 's/ / +/g' -e 's/^/+/' < /sys/fs/cgroup/cgroup.controllers \ + > /sys/fs/cgroup/cgroup.subtree_control +fi +## Dind wrapper over. + +# Handle DNS +set +e +cat /etc/resolv.conf | grep -i 'internal.cloudapp.net' +if [ $? -eq 0 ] +then + echo "Setting dockerd Azure DNS." + CUSTOMDNS="--dns 168.63.129.16" +else + echo "Not setting dockerd DNS manually." + CUSTOMDNS="" +fi +set -e + +# Start docker/moby engine +( sudoIf dockerd $CUSTOMDNS > /tmp/dockerd.log 2>&1 ) & + +set +e + +# Execute whatever commands were passed in (if any). This allows us +# to set this script to ENTRYPOINT while still executing the default CMD. +exec "$@" +EOF + +chmod +x /usr/local/share/docker-init.sh +chown ${USERNAME}:root /usr/local/share/docker-init.sh From efdc8afba8a59e9d3a63053f8df607346ac176a7 Mon Sep 17 00:00:00 2001 From: Evan Barger Date: Mon, 15 Mar 2021 15:10:10 -0400 Subject: [PATCH 13/15] Pull in static image on homepage with webpack vs using static folder Former-commit-id: 9a4e8fb5bc23c8b849b445eb67dc782d85dfb98b --- {static => src}/images/cli@2x.png | 0 src/pages/index.js | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) rename {static => src}/images/cli@2x.png (100%) diff --git a/static/images/cli@2x.png b/src/images/cli@2x.png similarity index 100% rename from static/images/cli@2x.png rename to src/images/cli@2x.png diff --git a/src/pages/index.js b/src/pages/index.js index 6d0d5183ccb..f1cf41eb774 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -1,6 +1,7 @@ import React from 'react'; import { Container } from 'react-bootstrap'; import Icon, { iconNames } from '../components/icon/'; +import cliImg from '../images/cli@2x.png'; import { Footer, IndexSubNav, @@ -82,7 +83,7 @@ const Page = () => (
Illustration of a Kubernetes Terminal Command From f808ece5384c5de198e24d0f8c544a2429eb731f Mon Sep 17 00:00:00 2001 From: nidhibhammar <59045594+nidhibhammar@users.noreply.github.com> Date: Tue, 16 Mar 2021 12:46:12 +0530 Subject: [PATCH 14/15] Formatting for a note is fixed in PEM Upgrade guide Formatting for a note is fixed in PEM Upgrade guide Former-commit-id: 148bb62094e9a333b30c451b2f593fec2e91b7f9 --- .../02_upgrading_backend_database.mdx | 108 +++++++++--------- .../pem_upgrade/03_moving_pem_server.mdx | 11 +- .../02_upgrading_backend_database.mdx | 10 +- .../8.0/pem_upgrade/03_moving_pem_server.mdx | 8 +- 4 files changed, 67 insertions(+), 70 deletions(-) diff --git a/product_docs/docs/pem/8.0.1/pem_upgrade/02_upgrading_backend_database.mdx b/product_docs/docs/pem/8.0.1/pem_upgrade/02_upgrading_backend_database.mdx index a9f5df3c482..051ed317956 100644 --- a/product_docs/docs/pem/8.0.1/pem_upgrade/02_upgrading_backend_database.mdx +++ b/product_docs/docs/pem/8.0.1/pem_upgrade/02_upgrading_backend_database.mdx @@ -12,57 +12,56 @@ The update process described in this section uses the `pg_upgrade` utility to mi !!! Note If the source PEM Server is lower than the 7.16 version, then you need to replace the following functions before you run `pg_upgrade`: -```` -- The `abstime`, `reltime`, and `tinterval` datatypes are depreacated from Postgres version 12 or later, hence to replace those dataypes with `timestamptz` data type use below command: - -```text -DO -$$ -DECLARE - rec record; - cnt integer; -BEGIN - -- Check for the deprecated type in our user info probe - SELECT count(*) INTO cnt - FROM pem.probe_column - WHERE sql_data_type = ‘abstime’ AND internal_name = ‘valuntil’; - IF cnt = 0 THEN - RETURN; - END IF; - ALTER TABLE pemdata.user_info - ALTER COLUMN valuntil SET DATA TYPE timestamptz; - ALTER TABLE pemhistory.user_info - ALTER COLUMN valuntil SET DATA TYPE timestamptz; - -- Now update the pem.probe_column itself - UPDATE pem.probe_column - SET sql_data_type = ‘timestamptz’ - WHERE sql_data_type = ‘abstime’ AND internal_name = ‘valuntil’; -END; -$$ LANGUAGE ‘plpgsql’; -``` - -- Replace the below function to avoid any alert errors: - -```text -CREATE OR REPLACE FUNCTION pem.check_alert_params_array_size( -template_id pem.alert_template.id%type, params text[] -) -RETURNS bool AS $FUNC$ -DECLARE - res bool := TRUE; -BEGIN - /* - * During restoring the pem database, it does not maintain the order while - * inserting data in the table, and uses the sort table based on the - * names. - * Hence - we need to check the foreign key constraint is present before - * validating these values. - */ - IF EXISTS( - SELECT 1 FROM information_schema.table_constraints - WHERE constraint_name='alert_template_id_fkey' AND - table_name='alert' AND table_schema='pem' - ) THEN + - The `abstime`, `reltime`, and `tinterval` datatypes are deprecated from Postgres version 12 or later, hence to replace those dataypes with `timestamptz` data type use below command: + + ```text + DO + $$ + DECLARE + rec record; + cnt integer; + BEGIN + -- Check for the deprecated type in our user info probe + SELECT count(*) INTO cnt + FROM pem.probe_column + WHERE sql_data_type = ‘abstime’ AND internal_name = ‘valuntil’; + IF cnt = 0 THEN + RETURN; + END IF; + ALTER TABLE pemdata.user_info + ALTER COLUMN valuntil SET DATA TYPE timestamptz; + ALTER TABLE pemhistory.user_info + ALTER COLUMN valuntil SET DATA TYPE timestamptz; + -- Now update the pem.probe_column itself + UPDATE pem.probe_column + SET sql_data_type = ‘timestamptz’ + WHERE sql_data_type = ‘abstime’ AND internal_name = ‘valuntil’; + END; + $$ LANGUAGE ‘plpgsql’; + ``` + + - Replace the below function to avoid any alert errors: + + ```text + CREATE OR REPLACE FUNCTION pem.check_alert_params_array_size( + template_id pem.alert_template.id%type, params text[] + ) + RETURNS bool AS $FUNC$ + DECLARE + res bool := TRUE; + BEGIN + /* + * During restoring the pem database, it does not maintain the order while + * inserting data in the table, and uses the sort table based on the + * names. + * Hence - we need to check the foreign key constraint is present before + * validating these values. + */ + IF EXISTS( + SELECT 1 FROM information_schema.table_constraints + WHERE constraint_name='alert_template_id_fkey' AND + table_name='alert' AND table_schema='pem' + ) THEN /* * Need to use the IS TRUE construct outside the main query, because * otherwise if there's no template by that ID then the query would return @@ -83,10 +82,9 @@ BEGIN $SQL$ INTO res USING template_id, params; END IF; RETURN res; -END -$FUNC$ LANGUAGE 'plpgsql'; -``` -```` + END + $FUNC$ LANGUAGE 'plpgsql'; + ``` `pg_upgrade` supports a transfer of data between servers of the same type. For example, you can use `pg_upgrade` to move data from a PostgreSQL 9.6 backend database to a PostgreSQL 11 backend database, but not to an Advanced Server 11 backend database. If you wish to migrate to a different type of backend database (i.e from a PostgreSQL server to Advanced Server), see [Moving the Postgres Enterprise Manager Server](03_moving_pem_server). diff --git a/product_docs/docs/pem/8.0.1/pem_upgrade/03_moving_pem_server.mdx b/product_docs/docs/pem/8.0.1/pem_upgrade/03_moving_pem_server.mdx index e3a7af41cfd..fc0d1734201 100644 --- a/product_docs/docs/pem/8.0.1/pem_upgrade/03_moving_pem_server.mdx +++ b/product_docs/docs/pem/8.0.1/pem_upgrade/03_moving_pem_server.mdx @@ -80,11 +80,11 @@ Before starting the server migration, you should ensure that the firewalls betwe Note that invoking the `pg_dump` utility will not interrupt current database users. - !!! Note - If the source PEM Server is lower than the 7.16 version, then you need to replace the following functions before you run `pg_dump` to take backup: + !!! Note + If the source PEM Server is lower than the 7.16 version, then you need to replace the following functions before you run `pg_dump` to take backup: - ```` - - The ``abstime``, ``reltime``, and ``tinterval`` datatypes are depreacated from Postgres version 12 or later, hence to replace those dataypes with ``timestamptz`` data type use below command: + + - The ``abstime``, ``reltime``, and ``tinterval`` datatypes are deprecated from Postgres version 12 or later, hence to replace those dataypes with ``timestamptz`` data type use below command: ```text DO @@ -112,7 +112,7 @@ Before starting the server migration, you should ensure that the firewalls betwe $$ LANGUAGE ‘plpgsql’; ``` - - Replace the below function to avoid any alert errors: + - Replace the below function to avoid any alert errors: ```text CREATE OR REPLACE FUNCTION pem.check_alert_params_array_size( @@ -157,7 +157,6 @@ Before starting the server migration, you should ensure that the firewalls betwe END $FUNC$ LANGUAGE 'plpgsql'; ``` - ```` 5. Move the Backup to the Target Host diff --git a/product_docs/docs/pem/8.0/pem_upgrade/02_upgrading_backend_database.mdx b/product_docs/docs/pem/8.0/pem_upgrade/02_upgrading_backend_database.mdx index 5b3484f6478..2d7a1659d02 100644 --- a/product_docs/docs/pem/8.0/pem_upgrade/02_upgrading_backend_database.mdx +++ b/product_docs/docs/pem/8.0/pem_upgrade/02_upgrading_backend_database.mdx @@ -8,15 +8,15 @@ legacyRedirectsGenerated: If you are updating both PEM components and the PEM backend database, you should perform PEM component updates (the server and Agent) before updating the backend database. For more information about updating PEM component software, see [Upgrading a PEM Installation](01_upgrading_pem_installation/#upgrading_pem_installation). -!!! Note -From PEM 8.0 onwards, the PostgreSQL or EPAS version 11 or higher are only supported as backend database server. Hence if your backend database server is lower than version 11 then first you need to upgrade your backend database server and then upgrade the PEM components. +!!! Note + From PEM 8.0 onwards, the PostgreSQL or EPAS version 11 or higher are only supported as backend database server. Hence if your backend database server is lower than version 11 then first you need to upgrade your backend database server and then upgrade the PEM components. The update process described in this section uses the `pg_upgrade` utility to migrate from one version of the backend server to a more recent version. `pg_upgrade` facilitates migration between any version of Postgres (version 9.5 or later), and any subsequent release of Postgres that is supported on the same platform. !!! Note -If the source PEM Server is lower than the 7.16 version, then you need to replace the following functions before you run `pg_upgrade`: + If the source PEM Server is lower than the 7.16 version, then you need to replace the following functions before you run `pg_upgrade`: - - The `abstime`, `reltime`, and `tinterval` datatypes are depreacated from Postgres version 12 or later, hence to replace those dataypes with `timestamptz` data type use below command: + - The `abstime`, `reltime`, and `tinterval` datatypes are deprecated from Postgres version 12 or later, hence to replace those dataypes with `timestamptz` data type use following command: ```text DO @@ -44,7 +44,7 @@ If the source PEM Server is lower than the 7.16 version, then you need to replac $$ LANGUAGE ‘plpgsql’; ``` - - Replace the below function to avoid any alert errors: + - Replace the below function to avoid any alert errors: ```text CREATE OR REPLACE FUNCTION pem.check_alert_params_array_size( diff --git a/product_docs/docs/pem/8.0/pem_upgrade/03_moving_pem_server.mdx b/product_docs/docs/pem/8.0/pem_upgrade/03_moving_pem_server.mdx index 3d39680f13e..27f6ef09cbd 100644 --- a/product_docs/docs/pem/8.0/pem_upgrade/03_moving_pem_server.mdx +++ b/product_docs/docs/pem/8.0/pem_upgrade/03_moving_pem_server.mdx @@ -84,10 +84,10 @@ Before starting the server migration, you should ensure that the firewalls betwe Note that invoking the `pg_dump` utility will not interrupt current database users. - !!! Note - If the source PEM Server is lower than the 7.16 version, then you need to replace the following functions before you run ``pg_dump`` to take backup: + !!! Note + If the source PEM Server is lower than the 7.16 version, then you need to replace the following functions before you run ``pg_dump`` to take backup: - - The ``abstime``, ``reltime``, and ``tinterval`` datatypes are depreacated from Postgres version 12 or later, hence to replace those dataypes with ``timestamptz`` data type use below command: + - The ``abstime``, ``reltime``, and ``tinterval`` datatypes are depreacated from Postgres version 12 or later, hence to replace those dataypes with ``timestamptz`` data type use below command: ```text DO @@ -115,7 +115,7 @@ Before starting the server migration, you should ensure that the firewalls betwe $$ LANGUAGE ‘plpgsql’; ``` - - Replace the below function to avoid any alert errors: + - Replace the below function to avoid any alert errors: ```text CREATE OR REPLACE FUNCTION pem.check_alert_params_array_size( From 92d669d17b47ba44e590ec76f65105ddd0656c08 Mon Sep 17 00:00:00 2001 From: josh-heyer Date: Tue, 16 Mar 2021 10:15:48 +0000 Subject: [PATCH 15/15] New PDFs generated by Github Actions Former-commit-id: 16169c25acb78c1baf8693954f1bf00c00dd71b8