Skip to content
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

ansible: prepare jenkins-workspace machines for linting duty #2008

Merged
merged 1 commit into from
Oct 30, 2019
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 ansible/inventory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ hosts:
ubuntu1604-arm64-2: {ip: 147.75.74.174}
# when adding, removing or changing the IPs below,
# remember to update Jenkins worker IP whitelist in github-bot
ubuntu1604-x64-1: {ip: 147.75.70.237, alias: jenkins-workspace-1}
ubuntu1604-x64-1: {ip: 147.75.70.41, alias: jenkins-workspace-1}
ubuntu1604-x64-2: {ip: 147.75.73.189, alias: jenkins-workspace-2}

- nearform:
Expand Down
35 changes: 3 additions & 32 deletions ansible/playbooks/jenkins/worker/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,42 +68,13 @@
roles:
- linux-perf

#
# Set up linter servers
#

- hosts:
- test-joyent-freebsd10-x64-2
- test-rackspace-freebsd10-x64-1

tasks:
- name: install lint-related packages
package:
name: "{{ package }}"
state: present
loop_control:
loop_var: package
with_items: [ "node", "npm" ]

- name: install core-validate-commit
npm:
name: "core-validate-commit"
global: yes
state: present
production: yes

- name: periodically update core-validate-commit
cron:
special_time: daily
# ksh does different stdout/err routing
job: "npm update -g core-validate-commit > & /dev/null"

# Ensure node is not installed anywhere but the linter servers
- hosts:
- test
- release
- "!test-joyent-freebsd10-x64-2"
- "!test-rackspace-freebsd10-x64-1"
- "!test-packetnet-ubuntu1604-x64-1"
- "!test-packetnet-ubuntu1604-x64-2"
- "!test-softlayer-ubuntu1604-x64-1"
Copy link
Member

Choose a reason for hiding this comment

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

There is a "Set up linter servers" section just above this, that runs exclusively on the two hosts being removed here. Shouldn't that section be completely removed? There are some bits about core-validate-commit there that I don't know if are still relevant in some scenario.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, missed that, also missed core-validate-commit. There is a job: https://ci.nodejs.org/job/node-test-commitmsg/ that runs it but it hasn't had any runs since the last build cleanup (~1 week). Does that mean it's disabled? Maybe this is all handled happily in Travis now and in node-core-utils. @nodejs/tooling can you weigh in here? Can we remove node-test-commitmsg from Jenkins and the associated server resources for running it?

Copy link
Member

Choose a reason for hiding this comment

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

We are definitely running core-validate-commit as part of node-core-utils and on Travis for PRs and that should be sufficient for the normal PR workflows for core.

An old issue, #793, proposed adding https://ci.nodejs.org/job/node-test-commitmsg/ to node-test-pull-request but that didn't happen.

Copy link
Member Author

Choose a reason for hiding this comment

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

Integrating core-validate-commit into my .ci.yml proposal; a failing v8.x: https://ci.nodejs.org/job/rv-test-commit-linux-docker/129/label=docker-host-x64,linux_x64_container_suite=lint-commit/console, ci.yml entry (see 'tests->lint-commit' block): https://github.com/rvagg/io.js/blob/rvagg/testing-containers-v8.x/.ci.yml

I might archive that Jenkins job since it's not in use, it can be unarchived if there's reason to before it eventually gets deleted.

tasks:
- name: remove node and npm packages
when: not os|startswith("win") and not os|startswith("zos")
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/baselayout/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ packages: {
],

ubuntu: [
'ccache,g++,gcc,g++-6,gcc-6,git,libfontconfig1,sudo',
'ccache,g++,gcc,g++-6,gcc-6,git,libfontconfig1,sudo,python3-pip',
],

ubuntu1404: [
Expand Down
28 changes: 28 additions & 0 deletions ansible/roles/jenkins-workspace/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,31 @@
command: "git config gc.auto 0"
args:
chdir: "~binary_tmp/binary_tmp.git/"

- name: Add nodesource signing key
apt_key:
url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
state: present

- name: Add nodesource repo
apt_repository:
repo: deb https://deb.nodesource.com/node_12.x xenial main
state: present

- name: Install node
package:
name: nodejs
state: present

- name: Upgrade pip2
rvagg marked this conversation as resolved.
Show resolved Hide resolved
pip:
name: pip
executable: pip2
state: latest

- name: Upgrade pip3
pip:
name: pip
executable: pip3
state: latest