simonsobs / simonsobs/ocs

Update site_config to use wildcard string for generic matching, rather than localhost

Open
#263 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
19
Forks
7
PR merge metrics
No merged PRs in 30d

Description

When identifying the host and updating site.hub, site_config.get_config checks for the given site_host, the hostname of the computer, or 'localhost' in the site config file. Use of 'localhost' in the SCF should be discouraged.

This is done here:
https://github.com/simonsobs/ocs/blob/0709db2ae1ac11dbb808282d866b23de554b6d41/ocs/site_config.py#L445

'localhost' should be replace with some unique wildcard string, i.e. '*default*', and a warning should be issued when it's used. The idea being that if you know the hostname, that should be configured in the SCF. Else, you're probably using this wildcard for some local testing on a single node.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in ocs/site_config.py at site_config.get_config, especially the matching logic around lines 402 and 445. Replace the localhost fallback with the requested unique wildcard and issue a warning when that wildcard is used; done means generic matching no longer relies on localhost.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.