Skip to content

Commit

Permalink
#982: adding index templates for cslc, k_cslc, and cslc_compressed in…
Browse files Browse the repository at this point in the history
…dices
  • Loading branch information
philipjyoon committed Sep 11, 2024
1 parent 7b8d6f4 commit 8ae0602
Show file tree
Hide file tree
Showing 11 changed files with 112 additions and 11 deletions.
29 changes: 18 additions & 11 deletions conf/sds/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,19 @@ def update_grq_es():
def create_ilm_policy_grq():
_, hysds_dir, _ = resolve_role()

copy(
"~/.sds/files/elasticsearch/es_ilm_policy_grq.json",
f"{hysds_dir}/ops/grq2/config/es_ilm_policy_grq.json"
)
run(
"curl --request PUT --url 'localhost:9200/_ilm/policy/opera_grq_ilm_policy?pretty' "
"--fail-with-body "
f"--json @{hysds_dir}/ops/grq2/config/es_ilm_policy_grq.json"
)
for file, policy in [
("es_ilm_policy_grq.json", "opera_grq_ilm_policy"),
("es_ilm_policy_grq_c_cslc.json", "opera_grq_c_cslc_ilm_policy")]:

copy(
f"~/.sds/files/elasticsearch/{file}",
f"{hysds_dir}/ops/grq2/config/{file}"
)
run(
f"curl --request PUT --url 'localhost:9200/_ilm/policy/{policy}?pretty' "
"--fail-with-body "
f"--json @{hysds_dir}/ops/grq2/config/{file}"
)


@roles("grq")
Expand All @@ -275,10 +279,13 @@ def create_index_templates_grq():
("es_template_hls_spatial_catalog.json", "hls_spatial_catalog_template"),
("es_template_slc_catalog.json", "slc_catalog_template"),
("es_template_slc_spatial_catalog.json", "slc_spatial_catalog_template"),
("es_template_rtc_catalog.json", "rtc_catalog_template")
("es_template_rtc_catalog.json", "rtc_catalog_template"),
("es_template_cslc_catalog.json", "cslc_catalog_template"),
("es_template_k_cslc_catalog.json", "k_cslc_catalog_template"),
("es_template_cslc_compressed_product.json", "cslc_compressed_product_template")
]:
copy(
f"~/.sds/files/elasticsearch/{file}",
f"~/.sds/files/elasticsearch/grq_es_templates/{file}",
f"{hysds_dir}/ops/grq2/config/{file}"
)
run(
Expand Down
25 changes: 25 additions & 0 deletions conf/sds/files/elasticsearch/es_ilm_policy_grq_c_cslc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"policy": {
"phases": {
"hot": {
"min_age": "0ms",
"actions": {
"set_priority": {
"priority": 100
}
}
},
"warm": {
"min_age": "32d",
"actions": {
"migrate": {
"enabled": false
},
"set_priority": {
"priority": 50
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"index_patterns": ["cslc_catalog", "cslc_catalog-*"],
"template": {
"settings": {
"index": {
"sort.field": "creation_timestamp",
"sort.order": "asc"
},
"index.lifecycle.name": "opera_grq_ilm_policy",
"number_of_shards": 8
},
"mappings": {
"properties": {
"granule_id" : {"type": "keyword"},
"revision_id" : {"type": "integer"},
"s3_url" : {"type": "keyword"},
"https_url" : {"type": "keyword"},
"creation_timestamp": {"type": "date" },
"download_datetime" : {"type": "date" },
"downloaded" : {"type": "boolean"}
}
},
"aliases": {
"catalog_alias": {},
"cslc_catalog_alias": {}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"index_patterns": ["grq_1_l2_cslc_s1_compressed", "grq_1_l2_cslc_s1_compressed-*"],
"template": {
"settings": {
"index": {
"sort.field": "creation_timestamp",
"sort.order": "asc"
},
"index.lifecycle.name": "opera_grq_ilm_c_cslc_policy",
"number_of_shards": 8
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"index_patterns": ["k_cslc_catalog", "k_cslc_catalog-*"],
"template": {
"settings": {
"index": {
"sort.field": "creation_timestamp",
"sort.order": "asc"
},
"index.lifecycle.name": "opera_grq_ilm_policy",
"number_of_shards": 8
},
"mappings": {
"properties": {
"granule_id" : {"type": "keyword"},
"revision_id" : {"type": "integer"},
"s3_url" : {"type": "keyword"},
"https_url" : {"type": "keyword"},
"creation_timestamp": {"type": "date" },
"download_datetime" : {"type": "date" },
"downloaded" : {"type": "boolean"}
}
},
"aliases": {
"catalog_alias": {},
"k_cslc_catalog_alias": {}
}
}
}

0 comments on commit 8ae0602

Please sign in to comment.