-
Notifications
You must be signed in to change notification settings - Fork 13
Deploy check in to prod #246
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
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e1a4282
Select db host conditionally depending on the host
LDiazN aef9f82
Add prod clickhouse proxy to firewall rules
LDiazN d74d5a9
Add clickhouse readonly url parameter to prod
LDiazN 783c226
mc
LDiazN 8e0be12
Merge branch 'main' of https://github.com/ooni/devops
LDiazN 079b748
Merge branch 'main' of https://github.com/ooni/devops
LDiazN 7341f28
Merge branch 'main' into deploy-check-in
LDiazN 27ef79b
Use host vars to set up clickhouse proxy per environment
LDiazN bdfdea4
Allow access from cluster to clickhouse proxy
LDiazN fed0377
Add rules for test-helpers
LDiazN File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| clickhouse_url: "clickhouse3.prod.ooni.io" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| clickhouse_url: "clickhouse1.prod.ooni.io" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| --- | ||
| # For prometheus scrape requests | ||
| - name: Flush all handlers | ||
| meta: flush_handlers | ||
|
|
||
| - name: Allow traffic on port 9100 | ||
| become: true | ||
| tags: prometheus-proxy | ||
| blockinfile: | ||
| path: /etc/ooni/nftables/tcp/9100.nft | ||
| create: yes | ||
| block: | | ||
| add rule inet filter input tcp dport 9100 counter accept comment "node exporter" | ||
| notify: | ||
| - reload nftables | ||
|
|
||
| # For incoming fastpath traffic | ||
| - name: Allow traffic on port 8472 | ||
| become: true | ||
| tags: fastpath | ||
| blockinfile: | ||
| path: /etc/ooni/nftables/tcp/8472.nft | ||
| create: yes | ||
| block: | | ||
| add rule inet filter input tcp dport 8472 counter accept comment "fastpath" | ||
| notify: | ||
| - reload nftables | ||
|
|
||
| # Docker seems to have problems with nftables, so this command will translate all iptables | ||
| # commands to nftables commands | ||
| - name: Update alternatives for iptables | ||
| tags: docker | ||
| become: yes | ||
| ansible.builtin.command: "update-alternatives --set iptables /usr/sbin/iptables-nft" | ||
| notify: | ||
| - restart docker | ||
|
|
||
| - name: Update alternatives for iptables | ||
| tags: docker | ||
| become: yes | ||
| ansible.builtin.command: "update-alternatives --set ip6tables /usr/sbin/ip6tables-nft" | ||
| notify: | ||
| - restart docker | ||
|
|
||
| - name: Flush all handlers # Required to apply iptables settings before docker runs | ||
| meta: flush_handlers | ||
|
|
||
| ### Create fastpath user | ||
| - name: Ensure the fastpath group exists | ||
| ansible.builtin.group: | ||
| name: "{{ fastpath_user }}" | ||
| state: present | ||
| become: yes | ||
| - name: Create the fastpath user | ||
| ansible.builtin.user: | ||
| name: "{{ fastpath_user }}" | ||
| home: "{{ fastpath_home }}" | ||
| shell: "/bin/bash" | ||
| group: "{{ fastpath_user }}" | ||
| create_home: yes | ||
| system: yes | ||
| become: yes | ||
| - name: Set ownership of the fastpath directory | ||
| ansible.builtin.file: | ||
| path: "{{ fastpath_home }}" | ||
| owner: "{{ fastpath_user }}" | ||
| group: "{{ fastpath_user }}" | ||
| state: directory | ||
| mode: '0755' | ||
| become: yes | ||
|
|
||
| - name: Create configuration file | ||
| tags: fastpath | ||
| template: | ||
| src: templates/fastpath.conf | ||
| dest: "/opt/{{fastpath_user}}/backend/fastpath/fastpath.conf" | ||
| mode: 0444 | ||
| owner: "{{fastpath_user}}" | ||
| become: yes | ||
|
|
||
| - name: Run docker container | ||
| tags: fastpath | ||
| ansible.builtin.command: "make docker-all" # TODO Change to `make docker` when clickhouse is migrated | ||
| args: | ||
| chdir: "/opt/{{fastpath_user}}/backend/fastpath" | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.