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

Docs Ubuntu Upgrade #415

Merged
33 commits merged into from
Apr 14, 2023
Merged

Docs Ubuntu Upgrade #415

33 commits merged into from
Apr 14, 2023

Conversation

ghost
Copy link

@ghost ghost commented Mar 10, 2023

This PR updates the docs server to Ubuntu 22.04 #381.
It also resolves ES SSL configuration issues #396 and #387, I have achieved this by moving ES behind Apache.

Questions

  1. From what I could see we are using one ES index ocdsindex_en? if we are using more I will need to reconfigure the proxy configuration as it is limiting access to one index.
  2. What is the best way to populate ElasticSearch?
  3. We need to update future docs deployments for the new ES URL (https://standard.open-contracting.org/ocdsindex_en/_search?size=100)

Go live plan

  • Merge and deploy
  • Copy /home/ocds-docs/web directory
rsync -avz ocp07:/home/ocds-docs/web/ /home/ocds-docs/web/
  • Copy ElasticSearch data
# Delete data on ocp19 before syncing.
rsync -avz ocp07:/var/lib/elasticsearch/ /var/lib/elasticsearch/
  • Update site search.js for new URL
find /home/ocds-docs/web/ -name search.js -exec sed -i "s/standard.open-contracting.org:9200/standard.open-contracting.org\/search/g" {} \+
  • Update DNS record for standard.open-contracting.org

Site Specific changes - With James

  • Commit change of URL to standard_theme repository
  • Update each documentation sub-site to the latest standard_profile_template (if we are upgrading ES)
  • Push changes, including to deployment branches (1.0, 1.1, etc.)

@ghost ghost requested a review from jpmckinney March 10, 2023 15:57
@ghost ghost self-assigned this Mar 10, 2023
@jpmckinney
Copy link
Member

From what I could see we are using one ES index ocdsindex_en? if we are using more I will need to reconfigure the proxy configuration as it is limiting access to one index.

There is one per language (ocdsindex_es, etc.).

What is the best way to populate ElasticSearch?

I think I've used https://github.com/elasticsearch-dump/elasticsearch-dump in the past.

We need to update future docs deployments for the new ES URL (https://standard.open-contracting.org/ocdsindex_en/_search?size=100)

Does that mean search will not work until docs are re-deployed? I guess this could involve #229

pillar/docs.sls Show resolved Hide resolved
salt/apache/files/sites/docs.conf.include Outdated Show resolved Hide resolved
@ghost
Copy link
Author

ghost commented Mar 13, 2023

@jpmckinney Did you want to take this opportunity to update Elasticsearch to version 8?

@jpmckinney
Copy link
Member

@jpmckinney Did you want to take this opportunity to update Elasticsearch to version 8?

I suppose we should. Support for 7 ends in August https://endoflife.date/elasticsearch

@ghost
Copy link
Author

ghost commented Mar 13, 2023

From what I could see we are using one ES index ocdsindex_en? if we are using more I will need to reconfigure the proxy configuration as it is limiting access to one index.

There is one per language (ocdsindex_es, etc.).

I have modified Elasticsearch and Apache to host the search under /search/, now all ES endpoints work as expected. :)
@jpmckinney , please can you check this works with ocds-index and any other tools.

You can test the new hosting by setting the following in your hosts file:

178.79.135.174  standard.open-contracting.org

What is the best way to populate ElasticSearch?

I have found a simple solution using rsync and recorded it in my original comment.
We may need to add other steps if we are upgrading ES along side this.

We need to update future docs deployments for the new ES URL (https://standard.open-contracting.org/ocdsindex_en/_search?size=100)

Does that mean search will not work until docs are re-deployed? I guess this could involve #229

I have put a find-replace command in my original comment to update search.js file as part of the migration. I believe this covers everything?
I'd like to leave issue #229 out of scope to help keep this PR concise.

@jpmckinney
Copy link
Member

jpmckinney commented Mar 13, 2023

please can you check this works with ocds-index and any other tools.

The current version of ocds-index will work as-is.

I've authored a new version that works with Elasticsearch 8. Are we upgrading Elasticsearch as part of this PR?

I have put a find-replace command in my original comment to update search.js file as part of the migration

This is not enough, because the next time we generate the documentation, we will get the port again.

The steps would be for me to:

  • Commit change of URL to standard_theme repository
  • Update each documentation sub-site to the latest standard_profile_template (if we are upgrading ES)
  • Push changes, including to deployment branches (1.0, 1.1, etc.)

@ghost
Copy link
Author

ghost commented Mar 13, 2023

Are we upgrading Elasticsearch as part of this PR?

I will test upgrading ES, if it is simple enough then let's add it into this PR.

pillar/docs.sls Outdated Show resolved Hide resolved
salt/elasticsearch/init.sls Outdated Show resolved Hide resolved
salt/elasticsearch/init.sls Outdated Show resolved Hide resolved
salt/elasticsearch/init.sls Outdated Show resolved Hide resolved
salt/elasticsearch/init.sls Outdated Show resolved Hide resolved
salt/elasticsearch/files/config/readonlyrest-docs.yml Outdated Show resolved Hide resolved
salt/elasticsearch/files/config/readonlyrest-docs.yml Outdated Show resolved Hide resolved
Rob Hooper and others added 2 commits March 17, 2023 15:53
Co-authored-by: James McKinney <[email protected]>
@ghost
Copy link
Author

ghost commented Mar 21, 2023

@jpmckinney I think this PR is ready merge from my side :)
We will need to coordinate deploying so you can make the site changes after the new server goes live.

salt/elasticsearch/files/config/readonlyrest-docs.yml Outdated Show resolved Hide resolved
salt/docs/init.sls Outdated Show resolved Hide resolved
salt/elasticsearch/files/config/readonlyrest-docs.yml Outdated Show resolved Hide resolved
salt/elasticsearch/init.sls Outdated Show resolved Hide resolved
salt/elasticsearch/init.sls Show resolved Hide resolved
docs/develop/update/elasticsearch.rst Outdated Show resolved Hide resolved
docs/develop/update/elasticsearch.rst Outdated Show resolved Hide resolved
docs/develop/update/elasticsearch.rst Show resolved Hide resolved
salt/docs/init.sls Show resolved Hide resolved
@ghost ghost merged commit 1a173d4 into main Apr 14, 2023
@ghost ghost deleted the docs-rebuild branch April 14, 2023 09:20
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Elasticsearch SSL Proxy Elasticsearch: Use PEM files instead of Keystore
1 participant