Skip to content

Ghost server use for maintainers - #7812

Merged
PaulWessel merged 21 commits into
masterfrom
ghost-server-use
Oct 3, 2023
Merged

PaulWessel merged 21 commits into
masterfrom
ghost-server-use

Conversation

@PaulWessel

Copy link
Copy Markdown
Contributor

Description of proposed changes

This PR follows the discussion on the data server setup, which now has been implemented and tested a bit. If the developers switch to this branch, build and run

gmt grdimage @mercury_relief_20m -B -png map --GMT_DATA_SERVER=candidate

then in a few seconds you should see

grdimage [NOTICE]: Remote data courtesy of GMT data server candidate [http://candidate.generic-mapping-tools.org]


grdimage [NOTICE]: Messenger Mercury Relief at 20x20 arc minutes reduced by Gaussian Cartesian filtering (14 km fullwidth) [Becker et al., 2016].
grdimage [NOTICE]:   -> Download grid file [864K]: mercury_relief_20m_p.grd

map

If some of you could give it a try that would be good. Also would be good to make a plot with 6.4 and determine that nothing has changed there.

This PR will place data and info from a ghost server (i.e., candidate, static, or test) in a subdirectory by the same name of the USERDIR.  This way, anything valuable in server and cache will not get polluted by data from those servers.
@PaulWessel PaulWessel added the maintenance Boring but important stuff for the core devs label Sep 12, 2023
@PaulWessel PaulWessel added this to the 6.5.0 milestone Sep 12, 2023
@PaulWessel PaulWessel self-assigned this Sep 12, 2023
@PaulWessel PaulWessel changed the title Ghost server use for maintainers WIP Ghost server use for maintainers Sep 12, 2023

@joa-quim joa-quim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

WTF cpt. Man, you want us trucidate by the paladins of uniform luminance.

@PaulWessel

Copy link
Copy Markdown
Contributor Author

I dont think we finished discussing the planetary CPT so this is probably a placeholder for now.

@Esteban82

Copy link
Copy Markdown
Member

@PaulWessel

Copy link
Copy Markdown
Contributor Author

Well, the mercury CPT is the same used here https://astrogeology.usgs.gov/search/map/Mercury/Topography/MESSENGER/Mercury_Messenger_USGS_ClrShade_Global_2km .

I cannot find a CPT there? Do you mean you back-engineered the CPT from the image and data? Or I guess you used the legend and sampled the rgb from each box in the bar? I note the strange yellow band with orange above and below in the legend. Are they trying to highlight a particular z-range?

@Esteban82

Esteban82 commented Sep 12, 2023 •

Copy link
Copy Markdown
Member

Yes, I back-engineered the CPT from this image.

I created lists with the values (valores.txt) and with the colors (colores.txt).

And them I make a continuos CPT with:

N=35
colors=$(head colores.txt -n$N | tr -s "\n\r" "," | sed 's/,$//')
valores=$(head valores.txt -n$N | tr -s "\n\r" "," | sed 's/,$//')
gmt makecpt -C$colors -T$valores -H -Z > mercury.cpt

I got this CPT: GenericMappingTools/gmtserver-admin#182 (comment)

@PaulWessel

Copy link
Copy Markdown
Contributor Author

OK, if that is the official Mercury map then why not use this as the default, @joa-quim ?

@PaulWessel PaulWessel closed this Sep 12, 2023
@PaulWessel PaulWessel reopened this Sep 12, 2023
@joa-quim

Copy link
Copy Markdown
Member

It's esoteric but who am I to censure it.

@seisman

seisman commented Sep 13, 2023

Copy link
Copy Markdown
Member

Yes, I back-engineered the CPT from this image.

Maybe we can ask them for the CPT file they used to make the plot?

@PaulWessel

Copy link
Copy Markdown
Contributor Author

Yes, I back-engineered the CPT from this image.

Maybe we can ask them for the CPT file they used to make the plot?

Yep. I just sent them an email.

@PaulWessel PaulWessel changed the title WIP Ghost server use for maintainers Ghost server use for maintainers Sep 17, 2023
@PaulWessel

Copy link
Copy Markdown
Contributor Author

I believe this PR is now working well. If you do export GMT_DATA_SERVER=static and then run all the tests they will get data from the static server and not oceania. You can try candidate as well and see how many more failures we get because the data sets have all been updated there. Maybe @seisman can think of a simple solution to have export GMT_DATA_SERVER=static set when we run in the CI?

With static I get 56 failures on macOS. Some of these are real failures while most are earth relief related. If you can run the tests via static, please post your results. If we all have some failures in common then I think a PS update is reasonable.

@PaulWessel PaulWessel changed the title WIP Ghost server use for maintainers Ghost server use for maintainers Oct 1, 2023
@PaulWessel

Copy link
Copy Markdown
Contributor Author

If you build from this branch (which I think is ready for approval) you can try things like

gmt grdimage @mercury_relief_01d -B -png mercury --GMT_DATA_SERVER=candidate
gmt grdimage @venus_relief_01d -B -png venus --GMT_DATA_SERVER=candidate
gmt grdimage @earth_relief_01d -B -png new_earth --GMT_DATA_SERVER=candidate
gmt grdimage @earth_relief_01d -B -png old_earth

@seisman

seisman commented Oct 2, 2023

Copy link
Copy Markdown
Member

Here is the folder structure (only 3 levels are shown) after running the 4 commands you posted:

$ tree -L 3
.
├── cache
├── candidate
│   ├── cache
│   │   ├── mercury_relief.cpt
│   │   └── venus_relief.cpt
│   └── server
│       ├── earth
│       ├── mercury
│       └── venus
├── server
│   ├── gmt_data_server.txt
│   ├── gmt_hash_server.txt
│   └── server
│       └── earth
├── sessions

Is the ~/.gmt/server/server/ directory intentional?

@PaulWessel

Copy link
Copy Markdown
Contributor Author

I just fixed issues related to cache, so that cache now goes under candidate, test, static but for others (e.g., oceania) it will go where it has always gone: in .gmt.

So the

gmt grdimage @earth_relief_01d -B -png old_earth

will create server. But if you did not rebuild the last 30 minutes you may wish to pull, build, delete the above and see what you get.

@seisman

seisman commented Oct 2, 2023

Copy link
Copy Markdown
Member

I was using the latest commit 6.5.0_1ac620d_2023.10.02 in #7812 (comment).

@PaulWessel

Copy link
Copy Markdown
Contributor Author

If I move my .gmt and create a blank one, running those 4 commands gives

.
|-- cache
|-- candidate
|   |-- cache
|   |   |-- mercury_relief.cpt
|   |   `-- venus_relief.cpt
|   `-- server
|       |-- earth
|       |-- mercury
|       `-- venus
|-- server
|   |-- gmt_data_server.txt
|   |-- gmt_hash_server.txt
|   `-- server
|       `-- earth
`-- sessions

Sam as you, so you can see the default (oceania) places both server and cache in the .gmt dir while the ghost servers places everything under the host server name. As intended, do you see any issues?

@seisman

seisman commented Oct 2, 2023

Copy link
Copy Markdown
Member

The issue is the ~/.gmt/server/server/earth (note the double "server") which used to be ~/.gmt/server/earth.

@PaulWessel

Copy link
Copy Markdown
Contributor Author

Right, OK will work on that too!

@PaulWessel

Copy link
Copy Markdown
Contributor Author

Now I get

tree -L 3
.
|-- candidate
|   |-- cache
|   |   |-- mercury_relief.cpt
|   |   `-- venus_relief.cpt
|   |-- gmt_data_server.txt
|   |-- gmt_hash_server.txt
|   `-- server
|       |-- earth
|       |-- mercury
|       `-- venus
|-- server
|   |-- earth
|   |   `-- earth_relief
|   |-- gmt_data_server.txt
|   `-- gmt_hash_server.txt
`-- sessions

@PaulWessel
PaulWessel merged commit 0b9cfe6 into master Oct 3, 2023
@PaulWessel
PaulWessel deleted the ghost-server-use branch October 3, 2023 06:59
@seisman

seisman commented Oct 3, 2023

Copy link
Copy Markdown
Member

Maybe @seisman can think of a simple solution to have export GMT_DATA_SERVER=static set when we run in the CI?

It's easy to set export GMT_DATA_SERVER=static in the CI, but what about local tests? We still want to use static when running the tests locally, right?

@PaulWessel

Copy link
Copy Markdown
Contributor Author

Sure, local tests are easy. Just export and run. That is not a problem. Sounds like the CI test you can do the same think. For a simple command one can do --DATA_SERVER=static but that does not scale to tests. Also gmt set DATASERVER static should work fine.

@seisman

seisman commented Oct 3, 2023

Copy link
Copy Markdown
Member

Since all tests are executed by the gmtest script, maybe we should add export GMT_DATA_SERVER=@GMT_DATA_SERVER@ to gmtest.in and set (GMT_DATA_SERVER "static") to our cmake/ConfigUser.camke?

@PaulWessel

Copy link
Copy Markdown
Contributor Author

Yes that is fine

Esteban82 added a commit that referenced this pull request Oct 6, 2026
* Fix gmt get -Dcache looking for the hash table in the wrong directory

Since 6.5.0 (#7812, #7879) gmt_hash_server.txt is stored in <USERDIR>/, but
gmt get still read <USERDIR>/server/gmt_hash_server.txt. So -Dcache and -Dall
failed with "Unable to access or read ..." (the error reported in #8895), or
silently used a stale copy left in server/ by an older GMT.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* gmtget: Do not download the cache when -Q is given

-Q means list but do not download (gmtget.rst), yet the -Dcache and -Dall
cache part ignored it. That went unnoticed because the cache part usually
failed before downloading anything; with the hash table found it would fetch
every cache file (about 118 MB).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* Revert "gmtget: Do not download the cache when -Q is given"

Moved to its own branch (fix-gmtget-q-cache) to go in a separate PR.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

---------

Co-authored-by: Claude Sonnet 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Boring but important stuff for the core devs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants