Skip to content

Minor improvements to Werft slices #12842

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 1 commit into from
Sep 9, 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
31 changes: 22 additions & 9 deletions .werft/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -228,19 +228,32 @@ pod:
sleep 1
set -Eeuo pipefail

sudo chown gitpod:gitpod $GOCACHE
export GITHUB_TOKEN=$(echo $GITHUB_TOKEN | xargs)

export DOCKER_HOST=tcp://$NODENAME:2375
sudo chown -R gitpod:gitpod /workspace

mkdir /workspace/.ssh
cp /mnt/secrets/harvester-vm-ssh-keys/id_rsa /workspace/.ssh/id_rsa_harvester_vm
cp /mnt/secrets/harvester-vm-ssh-keys/id_rsa.pub /workspace/.ssh/id_rsa_harvester_vm.pub
sudo chmod 600 /workspace/.ssh/id_rsa_harvester_vm
sudo chmod 644 /workspace/.ssh/id_rsa_harvester_vm.pub
echo "Job is running on node $NODENAME" | werft log slice "Node information"

( \
sudo chown gitpod:gitpod $GOCACHE && \
sudo chown -R gitpod:gitpod /workspace && \
echo "done" \
) | werft log slice "chowning /workspace and $GOCACHE"

( \
mkdir -p /workspace/.ssh && \
cp /mnt/secrets/harvester-vm-ssh-keys/id_rsa /workspace/.ssh/id_rsa_harvester_vm && \
cp /mnt/secrets/harvester-vm-ssh-keys/id_rsa.pub /workspace/.ssh/id_rsa_harvester_vm.pub && \
sudo chmod 600 /workspace/.ssh/id_rsa_harvester_vm && \
sudo chmod 644 /workspace/.ssh/id_rsa_harvester_vm.pub && \
echo "done" \
) | werft log slice "Prepare SSH keys"

( \
cd .werft && \
yarn install && \
mv node_modules .. \
) | werft log slice "Installing dependencies"

(cd .werft && yarn install && mv node_modules ..) | werft log slice prep
printf '{{ toJson . }}' > context.json

npx ts-node .werft/build.ts
Expand Down
3 changes: 2 additions & 1 deletion .werft/jobs/build/job-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ export function jobConfig(werft: Werft, context: any): JobConfig {
withLargeVM,
};

werft.log("job config", JSON.stringify(jobConfig));
werft.logOutput(sliceId, JSON.stringify(jobConfig, null, 2));
werft.log(sliceId, "Expand to see the parsed configuration")
const globalAttributes = Object.fromEntries(
Object.entries(jobConfig).map((kv) => {
const [key, value] = kv;
Expand Down