Skip to content

enable indexing with GoLand latest in prebuild as well #9246

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

Merged
merged 2 commits into from
Apr 13, 2022
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
2 changes: 1 addition & 1 deletion .github/workflows/jetbrains-auto-update-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
data=$(curl -sSL "https://data.services.jetbrains.com/products?code=${{ inputs.productCode }}&fields=distributions%2Clink%2Cname%2Creleases&_=$(date +%s)000")
link=$(echo "$data" | jq -r '.[0].releases[0].downloads.linux.link')
cd components/ide/jetbrains/image
leeway build -Dversion=latest -DimageRepoBase=eu.gcr.io/gitpod-core-dev/build -D${{ inputs.productId }}DownloadUrl=$link .:${{ inputs.productId }}
leeway build -Dversion=latest -DimageRepoBase=eu.gcr.io/gitpod-core-dev/build -DjetbrainsBackendQualifier=latest -D${{ inputs.productId }}DownloadUrl=$link .:${{ inputs.productId }}
- name: Slack Notification
if: always()
uses: rtCamp/action-slack-notify@v2
Expand Down
4 changes: 3 additions & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ tasks:
init: leeway exec --filter-type go -v -- go mod verify
openMode: split-right
- name: GoLand indexing
init: ./scripts/goland-indexing.sh
init: |
./scripts/goland-indexing.sh
./scripts/goland-latest-indexing.sh
vscode:
extensions:
- bradlc.vscode-tailwindcss
Expand Down
1 change: 1 addition & 0 deletions WORKSPACE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ defaultArgs:
publishToJBMarketplace: true
localAppVersion: unknown
codeCommit: e7430877d63066eb812360b3ec2b82f1fae9d558
jetbrainsBackendQualifier: stable
intellijDownloadUrl: "https://download.jetbrains.com/idea/ideaIU-2021.3.3.tar.gz"
golandDownloadUrl: "https://download.jetbrains.com/go/goland-2021.3.4.tar.gz"
pycharmDownloadUrl: "https://download.jetbrains.com/python/pycharm-professional-2021.3.3.tar.gz"
Expand Down
20 changes: 16 additions & 4 deletions components/ide/jetbrains/image/BUILD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ packages:
argdeps:
- imageRepoBase
- intellijDownloadUrl
- jetbrainsBackendQualifier
config:
dockerfile: leeway.Dockerfile
metadata:
helm-component: workspace.desktopIdeImages.intellij
buildArgs:
JETBRAINS_BACKEND_URL: ${intellijDownloadUrl}
SUPERVISOR_IDE_CONFIG: supervisor-ide-config_intellij.json
JETBRAINS_BACKEND_QUALIFIER: ${jetbrainsBackendQualifier}
image:
- ${imageRepoBase}/ide/intellij:${version}
- ${imageRepoBase}/ide/intellij:commit-${__git_commit}
Expand All @@ -51,8 +53,9 @@ packages:
helm-component: workspace.desktopIdeImages.intellijLatest
buildArgs:
# "https://data.services.jetbrains.com/products?code=IIU&fields=distributions%2Clink%2Cname%2Creleases&_=$(date +%s)000"
JETBRAINS_BACKEND_URL: "https://download.jetbrains.com/idea/ideaIU-221.4994.44.tar.gz"
JETBRAINS_BACKEND_URL: "https://download.jetbrains.com/idea/ideaIU-221.5080.169.tar.gz"
SUPERVISOR_IDE_CONFIG: supervisor-ide-config_intellij.json
JETBRAINS_BACKEND_QUALIFIER: latest
image:
- ${imageRepoBase}/ide/intellij:${version}-latest
- ${imageRepoBase}/ide/intellij:commit-${__git_commit}-latest
Expand All @@ -68,13 +71,15 @@ packages:
argdeps:
- imageRepoBase
- golandDownloadUrl
- jetbrainsBackendQualifier
config:
dockerfile: leeway.Dockerfile
metadata:
helm-component: workspace.desktopIdeImages.goland
buildArgs:
JETBRAINS_BACKEND_URL: ${golandDownloadUrl}
SUPERVISOR_IDE_CONFIG: supervisor-ide-config_goland.json
JETBRAINS_BACKEND_QUALIFIER: ${jetbrainsBackendQualifier}
image:
- ${imageRepoBase}/ide/goland:${version}
- ${imageRepoBase}/ide/goland:commit-${__git_commit}
Expand All @@ -95,8 +100,9 @@ packages:
helm-component: workspace.desktopIdeImages.golandLatest
buildArgs:
# "https://data.services.jetbrains.com/products?code=GO&fields=distributions%2Clink%2Cname%2Creleases&_=$(date +%s)000"
JETBRAINS_BACKEND_URL: "https://download.jetbrains.com/go/goland-221.4994.43.tar.gz"
JETBRAINS_BACKEND_URL: "https://download.jetbrains.com/go/goland-221.5080.169.tar.gz"
SUPERVISOR_IDE_CONFIG: supervisor-ide-config_goland.json
JETBRAINS_BACKEND_QUALIFIER: latest
image:
- ${imageRepoBase}/ide/goland:${version}-latest
- ${imageRepoBase}/ide/goland:commit-${__git_commit}-latest
Expand All @@ -112,13 +118,15 @@ packages:
argdeps:
- imageRepoBase
- pycharmDownloadUrl
- jetbrainsBackendQualifier
config:
dockerfile: leeway.Dockerfile
metadata:
helm-component: workspace.desktopIdeImages.pycharm
buildArgs:
JETBRAINS_BACKEND_URL: ${pycharmDownloadUrl}
SUPERVISOR_IDE_CONFIG: supervisor-ide-config_pycharm.json
JETBRAINS_BACKEND_QUALIFIER: ${jetbrainsBackendQualifier}
image:
- ${imageRepoBase}/ide/pycharm:${version}
- ${imageRepoBase}/ide/pycharm:commit-${__git_commit}
Expand All @@ -139,8 +147,9 @@ packages:
helm-component: workspace.desktopIdeImages.pycharmLatest
buildArgs:
# "https://data.services.jetbrains.com/products?code=PCP&fields=distributions%2Clink%2Cname%2Creleases&_=$(date +%s)000"
JETBRAINS_BACKEND_URL: "https://download.jetbrains.com/python/pycharm-professional-221.4994.44.tar.gz"
JETBRAINS_BACKEND_URL: "https://download.jetbrains.com/python/pycharm-professional-221.5080.186.tar.gz"
SUPERVISOR_IDE_CONFIG: supervisor-ide-config_pycharm.json
JETBRAINS_BACKEND_QUALIFIER: latest
image:
- ${imageRepoBase}/ide/pycharm:${version}-latest
- ${imageRepoBase}/ide/pycharm:commit-${__git_commit}-latest
Expand All @@ -156,13 +165,15 @@ packages:
argdeps:
- imageRepoBase
- phpstormDownloadUrl
- jetbrainsBackendQualifier
config:
dockerfile: leeway.Dockerfile
metadata:
helm-component: workspace.desktopIdeImages.phpstorm
buildArgs:
JETBRAINS_BACKEND_URL: ${phpstormDownloadUrl}
SUPERVISOR_IDE_CONFIG: supervisor-ide-config_phpstorm.json
JETBRAINS_BACKEND_QUALIFIER: ${jetbrainsBackendQualifier}
image:
- ${imageRepoBase}/ide/phpstorm:${version}
- ${imageRepoBase}/ide/phpstorm:commit-${__git_commit}
Expand All @@ -183,8 +194,9 @@ packages:
helm-component: workspace.desktopIdeImages.phpstormLatest
buildArgs:
# "https://data.services.jetbrains.com/products?code=PS&fields=distributions%2Clink%2Cname%2Creleases&_=$(date +%s)000"
JETBRAINS_BACKEND_URL: "https://download.jetbrains.com/webide/PhpStorm-221.4994.43.tar.gz"
JETBRAINS_BACKEND_URL: "https://download.jetbrains.com/webide/PhpStorm-221.5080.177.tar.gz"
SUPERVISOR_IDE_CONFIG: supervisor-ide-config_phpstorm.json
JETBRAINS_BACKEND_QUALIFIER: latest
image:
- ${imageRepoBase}/ide/phpstorm:${version}-latest
- ${imageRepoBase}/ide/phpstorm:commit-${__git_commit}-latest
3 changes: 3 additions & 0 deletions components/ide/jetbrains/image/leeway.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ COPY --chown=33333:33333 startup.sh /ide-desktop/
COPY --chown=33333:33333 --from=download /workdir/ /ide-desktop/backend/
COPY --chown=33333:33333 components-ide-jetbrains-image-status--app/status /ide-desktop

ARG JETBRAINS_BACKEND_QUALIFIER
ENV GITPOD_ENV_SET_JETBRAINS_BACKEND_QUALIFIER ${JETBRAINS_BACKEND_QUALIFIER}

COPY --chown=33333:33333 components-ide-jetbrains-cli--app/cli /ide-desktop/bin/idea-cli
ENV GITPOD_ENV_APPEND_PATH /ide-desktop/bin:

Expand Down
7 changes: 0 additions & 7 deletions components/ide/jetbrains/image/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,4 @@ if [ "${SUPERVISOR_DEBUG_ENABLE+}" = "true" ]; then
export JAVA_TOOL_OPTIONS "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:0"
fi

# Set default config and system directories under /workspace to preserve between restarts
export IJ_HOST_CONFIG_BASE_DIR=/workspace/.config/JetBrains
export IJ_HOST_SYSTEM_BASE_DIR=/workspace/.cache/JetBrains

# Enable host status endpoint
export CWM_HOST_STATUS_OVER_HTTP_TOKEN=gitpod

/ide-desktop/status "$@"
31 changes: 25 additions & 6 deletions components/ide/jetbrains/image/status/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ var (
)

const BackendPath = "/ide-desktop/backend"
const RemoteDevServer = BackendPath + "/bin/remote-dev-server.sh"
const ProductInfoPath = BackendPath + "/product-info.json"

// JB startup entrypoint
Expand Down Expand Up @@ -223,15 +222,36 @@ func run(wsInfo *supervisor.WorkspaceInfoResponse) {
var args []string
args = append(args, "run")
args = append(args, wsInfo.GetCheckoutLocation())
cmd := exec.Command(RemoteDevServer, args...)
cmd.Stderr = os.Stderr
cmd.Stdout = os.Stdout
cmd := remoteDevServerCmd(args)
// Enable host status endpoint
cmd.Env = append(cmd.Env, "CWM_HOST_STATUS_OVER_HTTP_TOKEN=gitpod")
if err := cmd.Run(); err != nil {
log.WithError(err).Error("failed to run")
}
os.Exit(cmd.ProcessState.ExitCode())
}

func remoteDevServerCmd(args []string) *exec.Cmd {
cmd := exec.Command(BackendPath+"/bin/remote-dev-server.sh", args...)
cmd.Env = os.Environ()

// Set default config and system directories under /workspace to preserve between restarts
qualifier := os.Getenv("JETBRAINS_BACKEND_QUALIFIER")
if qualifier == "stable" {
qualifier = ""
} else {
qualifier = "-" + qualifier
}
cmd.Env = append(cmd.Env,
fmt.Sprintf("IJ_HOST_CONFIG_BASE_DIR=/workspace/.config/JetBrains%s", qualifier),
fmt.Sprintf("IJ_HOST_SYSTEM_BASE_DIR=/workspace/.cache/JetBrains%s", qualifier),
)

cmd.Stderr = os.Stderr
cmd.Stdout = os.Stdout
return cmd
}

/**
{
"buildNumber" : "221.4994.44",
Expand Down Expand Up @@ -299,8 +319,7 @@ func installPlugins(wsInfo *supervisor.WorkspaceInfoResponse) error {
args = append(args, "installPlugins")
args = append(args, wsInfo.GetCheckoutLocation())
args = append(args, plugins...)
cmd := exec.Command(RemoteDevServer, args...)
cmd.Stderr = os.Stderr
cmd := remoteDevServerCmd(args)
cmd.Stdout = io.MultiWriter(w, os.Stdout)
installErr := cmd.Run()

Expand Down
23 changes: 23 additions & 0 deletions scripts/goland-latest-indexing.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

# skip indexing in regular workspaces
if [ ! "$GITPOD_HEADLESS" = "true" ] ; then exit ; fi

# resolve latest JetBrains backend version running by Gitpod
PRODUCT_CODE=GO
curl -sSL "https://data.services.jetbrains.com/products?code=$PRODUCT_CODE&fields=distributions%2Clink%2Cname%2Creleases&_=$(date +%s)000" > /tmp/jb_products.xml
JB_BACKEND_DOWNLOAD_URL=$(jq -r '.[0].releases[0].downloads.linux.link' /tmp/jb_products.xml)
echo "$JB_BACKEND_DOWNLOAD_URL"
Comment on lines +7 to +10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could possibly use https://download.jetbrains.com/product?distribution=linux&code=$PRODUCT_CODE here too. [1]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I'm not sure. It seems to have another semantic.


# download JB backend
mkdir /tmp/backend-latest && cd /tmp/backend-latest || exit 1
curl -sSLo backend-latest.tar.gz "$JB_BACKEND_DOWNLOAD_URL" && tar -xf backend-latest.tar.gz --strip-components=1 && rm backend-latest.tar.gz

# config JB system config and caches aligned with runtime
printf '\nshared.indexes.download.auto.consent=true' >> "/tmp/backend-latest/bin/idea.properties"
unset JAVA_TOOL_OPTIONS
export IJ_HOST_CONFIG_BASE_DIR=/workspace/.config/JetBrains-latest
export IJ_HOST_SYSTEM_BASE_DIR=/workspace/.cache/JetBrains-latest

# start JB backend in indexing mode
/tmp/backend-latest/bin/remote-dev-server.sh warmup "$GITPOD_REPO_ROOT"