Skip to content

Commit

Permalink
refactor: adjust vagrant spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Vonng committed Jul 6, 2024
1 parent 60e4511 commit 79f747f
Show file tree
Hide file tree
Showing 31 changed files with 722 additions and 382 deletions.
250 changes: 162 additions & 88 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# File : Makefile
# Desc : pigsty shortcuts
# Ctime : 2019-04-13
# Mtime : 2024-05-17
# Mtime : 2024-07-05
# Path : Makefile
# Author : Ruohang Feng (rh@vonng.com)
# License : AGPLv3
Expand Down Expand Up @@ -155,7 +155,7 @@ docker:


###############################################################
# 5. Sandbox #
# 5. Vagrant #
###############################################################
# shortcuts to pull up vm nodes with vagrant on your own MacOS
# DO NOT RUN THESE SHORTCUTS ON YOUR META NODE!!!
Expand Down Expand Up @@ -239,48 +239,6 @@ suspend:
cd vagrant && vagrant suspend
resume:
cd vagrant && vagrant resume
#------------------------------#
# vagrant templates:
v1:
cd vagrant && make v1
v4:
cd vagrant && make v4
v7:
cd vagrant && make v7
v8:
cd vagrant && make v8
v9:
cd vagrant && make v9
vb:
cd vagrant && make vb
vr:
cd vagrant && make vr
vd:
cd vagrant && make vd
vc:
cd vagrant && make vc
vm:
cd vagrant && make vm
vo:
cd vagrant && make vo
vu:
cd vagrant && make vu
vp: vp8 # use rocky 8 as default
vp7:
cd vagrant && make vp7
vp8:
cd vagrant && make vp8
vp9:
cd vagrant && make vp9
vp11:
cd vagrant && make vp11
vp12:
cd vagrant && make vp12
vp20:
cd vagrant && make vp20
vp22:
cd vagrant && make vp22
vnew: new ssh

###############################################################

Expand Down Expand Up @@ -445,69 +403,185 @@ publish:
###############################################################
# 9. Environment #
###############################################################
# validate offline packages with build environment
check-all: check-src check-repo check-boot
check-src:
scp dist/${VERSION}/${SRC_PKG} build-el8:~/pigsty.tgz ; ssh build-el8 "tar -xf pigsty.tgz";
scp dist/${VERSION}/${SRC_PKG} build-el9:~/pigsty.tgz ; ssh build-el9 "tar -xf pigsty.tgz";
scp dist/${VERSION}/${SRC_PKG} debian12:~/pigsty.tgz ; ssh debian12 "tar -xf pigsty.tgz";
scp dist/${VERSION}/${SRC_PKG} ubuntu22:~/pigsty.tgz ; ssh ubuntu22 "tar -xf pigsty.tgz";
check-repo:
scp dist/${VERSION}/pigsty-pkg-${VERSION}.el8.x86_64.tgz build-el8:/tmp/pkg.tgz ; ssh build-el8 'sudo mkdir -p /www; sudo tar -xf /tmp/pkg.tgz -C /www'
scp dist/${VERSION}/pigsty-pkg-${VERSION}.el9.x86_64.tgz build-el9:/tmp/pkg.tgz ; ssh build-el9 'sudo mkdir -p /www; sudo tar -xf /tmp/pkg.tgz -C /www'
scp dist/${VERSION}/pigsty-pkg-${VERSION}.debian12.x86_64.tgz debian12:/tmp/pkg.tgz ; ssh debian12 'sudo mkdir -p /www; sudo tar -xf /tmp/pkg.tgz -C /www'
scp dist/${VERSION}/pigsty-pkg-${VERSION}.ubuntu22.x86_64.tgz ubuntu22:/tmp/pkg.tgz ; ssh ubuntu22 'sudo mkdir -p /www; sudo tar -xf /tmp/pkg.tgz -C /www'
check-boot:
ssh build-el8 "cd pigsty; ./bootstrap -n ; ./configure -m el -i 10.10.10.8 -n";
ssh build-el9 "cd pigsty; ./bootstrap -n ; ./configure -m el -i 10.10.10.9 -n";
ssh debian12 "cd pigsty; ./bootstrap -n ; ./configure -m el -i 10.10.10.12 -n";
ssh ubuntu22 "cd pigsty; ./bootstrap -n ; ./configure -m el -i 10.10.10.22 -n";

meta: del v1 new ssh copy-el8 use-pkg
cp files/pigsty/demo.yml pigsty.yml
full: del v4 new ssh copy-el8 use-pkg
cp files/pigsty/demo.yml pigsty.yml
el8: del v8 new ssh copy-el8 use-pkg
cp files/pigsty/test.yml pigsty.yml
el9: del v9 new ssh copy-el9 use-pkg
cp files/pigsty/test.yml pigsty.yml
minio: del vm new ssh copy-el8 use-pkg
cp files/pigsty/citus.yml pigsty.yml
oss: del vo new ssh

#------------------------------#
# Building Environment #
#------------------------------#
pro: del vpro up ssh
oss: del voss up ssh
rpm: del vrpm up ssh
deb: del vdeb up ssh

vpro: # pro building environment
vagrant/switch pro
voss: # oss building environment
vagrant/switch oss
vrpm: # rpm building environment
vagrant/switch rpm
vdeb: # deb building environment
vagrant/switch deb

pro: del vpro new ssh
cp files/pigsty/pro.yml pigsty.yml
oss: del voss new ssh
cp files/pigsty/oss.yml pigsty.yml
ubuntu: del vu new ssh copy-u22 use-pkg
cp files/pigsty/ubuntu.yml pigsty.yml
build: del vb new ssh
cp files/pigsty/build.yml pigsty.yml
rpm: del vr new ssh
rpm: del vrpm new ssh
cp files/pigsty/rpm.yml pigsty.yml
@echo ./node.yml -i files/pigsty/rpmbuild.yml -t node_repo,node_pkg
@echo el8: sudo yum groupinstall --nobest -y 'Development Tools'
deb: del vd new ssh
deb: del vdeb new ssh
cp files/pigsty/deb.yml pigsty.yml
build-boot:
boot:
bin/build-boot
check: del vc new ssh
cp files/pigsty/check.yml pigsty.yml
checkb: del vc new ssh check-all
cp files/pigsty/check.yml pigsty.yml
prod8: del vp8 new ssh


#------------------------------#
# meta, single node, the devbox
#------------------------------#
# simple 1-node devbox for quick setup, demonstration, and development

meta: meta8
meta8: del vmeta8 new ssh copy-el8 use-pkg
cp files/pigsty/el8.yml pigsty.yml
meta9: del vmeta9 new ssh copy-el9 use-pkg
cp files/pigsty/el9.yml pigsty.yml
meta12: del vmeta12 new ssh copy-d12 use-pkg
cp files/pigsty/debian12.yml pigsty.yml
meta22: del vmeta22 new ssh copy-u22 use-pkg
cp files/pigsty/ubuntu22.yml pigsty.yml

full: del v4 new ssh copy-el8 use-pkg
cp files/pigsty/demo.yml pigsty.yml

vmeta: vmeta8
vmeta7:
vagrant/config meta el7
vmeta8:
vagrant/config meta el8
vmeta9:
vagrant/config meta el9
vmeta12:
vagrant/config meta debian12
vmeta20:
vagrant/config meta ubuntu20
vmeta22:
vagrant/config meta ubuntu22

#------------------------------#
# full, four nodes, the sandbox
#------------------------------#
# full-featured 4-node sandbox for HA-testing & tutorial & practices

full: full8
full7: del vfull7 up ssh
full8: del vfull8 up ssh
full9: del vfull9 up ssh
full11: del vfull11 up ssh
full12: del vfull12 up ssh
full20: del vfull20 up ssh
full22: del vfull22 up ssh


meta: meta8
meta8: del vmeta8 new ssh copy-el8 use-pkg
cp files/pigsty/el8.yml pigsty.yml
meta9: del vmeta9 new ssh copy-el9 use-pkg
cp files/pigsty/el9.yml pigsty.yml
meta12: del vmeta12 new ssh copy-d12 use-pkg
cp files/pigsty/debian12.yml pigsty.yml
meta22: del vmeta22 new ssh copy-u22 use-pkg
cp files/pigsty/ubuntu22.yml pigsty.yml

full: del v4 new ssh copy-el8 use-pkg
cp files/pigsty/demo.yml pigsty.yml


vfull: vfull8
vfull7:
vagrant/config full el7
vfull8:
vagrant/config full el8
vfull9:
vagrant/config full el9
vfull11:
vagrant/config full debian11
vfull12:
vagrant/config full debian12
vfull20:
vagrant/config full ubuntu20
vfull22:
vagrant/config full ubuntu22

#------------------------------#
# prod, 43 nodes, the simubox
#------------------------------#
# complex 43-node simubox for production simulation & complete testing

vprod: vprod8
vprod8:
vagrant/config prod el8
vprod9:
vagrant/config prod el9
vprod12:
vagrant/config prod debian12
vprod22:
vagrant/config prod ubuntu22

prod: prod8
prod8: del vprod8 new ssh
cp files/pigsty/prod.yml pigsty.yml
scp dist/${VERSION}/pigsty-pkg-${VERSION}.el8.x86_64.tgz meta-1:/tmp/pkg.tgz ; ssh meta-1 'sudo mkdir -p /www; sudo tar -xf /tmp/pkg.tgz -C /www'
scp dist/${VERSION}/pigsty-pkg-${VERSION}.el8.x86_64.tgz meta-2:/tmp/pkg.tgz ; ssh meta-2 'sudo mkdir -p /www; sudo tar -xf /tmp/pkg.tgz -C /www'
prod9: del vp9 new ssh
prod9: del vprod9 new ssh
cp files/pigsty/prod.yml pigsty.yml
scp dist/${VERSION}/pigsty-pkg-${VERSION}.el9.x86_64.tgz meta-1:/tmp/pkg.tgz ; ssh meta-1 'sudo mkdir -p /www; sudo tar -xf /tmp/pkg.tgz -C /www'
scp dist/${VERSION}/pigsty-pkg-${VERSION}.el9.x86_64.tgz meta-2:/tmp/pkg.tgz ; ssh meta-2 'sudo mkdir -p /www; sudo tar -xf /tmp/pkg.tgz -C /www'
prod12: del vp12 new ssh
prod12: del vprod12 new ssh
cp files/pigsty/prod-deb.yml pigsty.yml
scp dist/${VERSION}/pigsty-pkg-${VERSION}.debian12.x86_64.tgz meta-1:/tmp/pkg.tgz ; ssh meta-1 'sudo mkdir -p /www; sudo tar -xf /tmp/pkg.tgz -C /www'
scp dist/${VERSION}/pigsty-pkg-${VERSION}.debian12.x86_64.tgz meta-2:/tmp/pkg.tgz ; ssh meta-2 'sudo mkdir -p /www; sudo tar -xf /tmp/pkg.tgz -C /www'
prod22: del vp22 new ssh
prod22: del vprod22 new ssh
cp files/pigsty/prod-deb.yml pigsty.yml
scp dist/${VERSION}/pigsty-pkg-${VERSION}.ubuntu22.x86_64.tgz meta-1:/tmp/pkg.tgz ; ssh meta-1 'sudo mkdir -p /www; sudo tar -xf /tmp/pkg.tgz -C /www'
scp dist/${VERSION}/pigsty-pkg-${VERSION}.ubuntu22.x86_64.tgz meta-2:/tmp/pkg.tgz ; ssh meta-2 'sudo mkdir -p /www; sudo tar -xf /tmp/pkg.tgz -C /www'

#------------------------------#
# dual & trio
#------------------------------#
dual: del vdual up ssh
dual8: del vdual8 up ssh
dual9: del vdual9 up ssh
dual12: del vdual12 up ssh
dual22: del vdual22 up ssh

vdual: vdual8
vdual8:
vagrant/config dual el8
vdual9:
vagrant/config dual el9
vdual12:
vagrant/config dual debian12
vdual20:
vagrant/config dual ubuntu20
vdual22:
vagrant/config dual ubuntu22

trio: del vtrio up ssh
trio8: del vtrio8 up ssh
trio9: del vtrio9 up ssh
trio12: del vtrio12 up ssh
trio22: del vtrio22 up ssh
vtrio: vtrio8
vtrio8:
vagrant/config trio el8
vtrio9:
vagrant/config trio el9
vtrio12:
vagrant/config trio debian12
vtrio22:
vagrant/config trio ubuntu22


###############################################################


Expand Down
4 changes: 2 additions & 2 deletions files/pigsty/el7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ all:
pg-meta:
hosts:
10.10.10.10: { pg_seq: 1, pg_role: primary } # <---- primary instance with read-write capability
#10.10.10.x: { pg_seq: 2, pg_role: replica } # <---- read only replica for read-only online traffic
#10.10.10.y: { pg_seq: 3, pg_role: offline } # <---- offline instance of ETL & interactive queries
#x.xx.xx.xx: { pg_seq: 2, pg_role: replica } # <---- read only replica for read-only online traffic
#x.yy.yy.yy: { pg_seq: 3, pg_role: offline } # <---- offline instance of ETL & interactive queries
vars:
pg_cluster: pg-meta # required identity parameter, usually same as group name
pg_conf: oltp.yml # oltp|tiny|olap|crit|... (default: oltp)
Expand Down
4 changes: 2 additions & 2 deletions files/pigsty/el8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ all:
pg-meta:
hosts:
10.10.10.10: { pg_seq: 1, pg_role: primary } # <---- primary instance with read-write capability
#10.10.10.x: { pg_seq: 2, pg_role: replica } # <---- read only replica for read-only online traffic
#10.10.10.y: { pg_seq: 3, pg_role: offline } # <---- offline instance of ETL & interactive queries
#x.xx.xx.xx: { pg_seq: 2, pg_role: replica } # <---- read only replica for read-only online traffic
#x.yy.yy.yy: { pg_seq: 3, pg_role: offline } # <---- offline instance of ETL & interactive queries
vars:
pg_cluster: pg-meta # required identity parameter, usually same as group name
pg_conf: oltp.yml # oltp|tiny|olap|crit|... (default: oltp)
Expand Down
4 changes: 2 additions & 2 deletions files/pigsty/el9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ all:
pg-meta:
hosts:
10.10.10.10: { pg_seq: 1, pg_role: primary } # <---- primary instance with read-write capability
#10.10.10.x: { pg_seq: 2, pg_role: replica } # <---- read only replica for read-only online traffic
#10.10.10.y: { pg_seq: 3, pg_role: offline } # <---- offline instance of ETL & interactive queries
#x.xx.xx.xx: { pg_seq: 2, pg_role: replica } # <---- read only replica for read-only online traffic
#x.yy.yy.yy: { pg_seq: 3, pg_role: offline } # <---- offline instance of ETL & interactive queries
vars:
pg_cluster: pg-meta # required identity parameter, usually same as group name
pg_conf: oltp.yml # oltp|tiny|olap|crit|... (default: oltp)
Expand Down
10 changes: 5 additions & 5 deletions files/pigsty/full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# File : full.yml
# Desc : pigsty demo config with full default values
# Ctime : 2020-05-22
# Mtime : 2024-07-01
# Mtime : 2024-07-05
# Docs : https://pigsty.io/docs/setup/config/
# Author : Ruohang Feng (rh@vonng.com)
# License : AGPLv3
Expand Down Expand Up @@ -282,10 +282,10 @@ all:
- vault_16* pgjwt_16* pg_roaringbitmap_16* zhparser_16* hydra_16* apache-age_16* duckdb_fdw_16* pg_tde_16* md5hash_16* pg_dirtyread_16* plv8_16* parquet_s3_fdw_16* # Pigsty Extension (C)
- pgml_16 pg_graphql_16 wrappers_16 pg_jsonschema_16 pg_search_16 pg_lakehouse_16 pgmq_16 pg_tier_16 pg_later_16 pg_vectorize_16 pg_tiktoken_16 pgdd_16 plprql_16 pgsmcrypto_16 pg_idkit_16 pgvectorscale_16
- bgw_replstatus_16* count_distinct_16* credcheck_16* ddlx_16* e-maj_16* extra_window_functions_16* h3-pg_16* hdfs_fdw_16* hll_16* hypopg_16* ip4r_16* jsquery_16* # PGDG Extensions
- logerrors_16* login_hook_16* mongo_fdw_16* mysql_fdw_16* ogr_fdw_16* orafce_16* passwordcheck_cracklib_16* periods_16* pg_auth_mon_16* pg_auto_failover_16* pg_background_16* pgfincore_16* pgimportdoc_16* pgl_ddl_deploy_16* pgmemcache_16* pgmeminfo_16* pgmp_16* pgq_16* pgrouting_16* pgsodium_16* pgsql_gzip_16* pgsql_http_16* pgsql_tweaks_16*
- pgtt_16* pguint_16* pg_bigm_16* pg_bulkload_16* pg_catcheck_16* pg_checksums_16* pg_comparator_16* pg_dbms_lock_16* pg_dbms_metadata_16* pg_extra_time_16* pg_fact_loader_16* pg_failover_slots_16* pg_filedump_16* pg_fkpart_16* pg_hint_plan_16* pg_ivm_16* pg_jobmon_16* pg_net_16* pg_partman_16* pg_permissions_16* pg_prioritize_16* pg_profile_16*
- pg_qualstats_16* pg_readonly_16* pg_show_plans_16* pg_squeeze_16* pg_stat_kcache_16* pg_stat_monitor_16* pg_statement_rollback_16* pg_statviz_extension_16 pg_store_plans_16* pg_tle_16* pg_top_16* pg_track_settings_16* pg_uuidv7_16* pg_wait_sampling_16* pgagent_16* pgaudit_16* pgauditlogtofile_16* pgbouncer_fdw_16* pgcryptokey_16* pgexportdoc_16*
- pldebugger_16* pllua_16* plpgsql_check_16* plprofiler_16* plsh_16* pointcloud_16* postgres-decoderbufs_16* postgresql_anonymizer_16* postgresql_faker_16* powa-archivist_16* powa_16* prefix_16* rum_16 safeupdate_16* semver_16* set_user_16* sqlite_fdw_16* system_stats_16* tdigest_16* tds_fdw_16* temporal_tables_16* timestamp9_16* topn_16*
- logerrors_16* login_hook_16* mongo_fdw_16* multicorn2_16* mysql_fdw_16* ogr_fdw_16* orafce_16* passwordcheck_cracklib_16* periods_16* pg_auth_mon_16* pg_auto_failover_16* pg_background_16* pgfincore_16* pgimportdoc_16* pgl_ddl_deploy_16* pgmemcache_16* pgmeminfo_16* pgmp_16* pgq_16* pgrouting_16* pgsodium_16* pgsql_gzip_16* pgsql_http_16* pgsql_tweaks_16*
- pgtt_16* pguint_16* pg_bigm_16* pg_bulkload_16* pg_catcheck_16* pg_checksums_16* pg_comparator_16* pg_dbms_lock_16* pg_dbms_job_16* pg_dbms_metadata_16* pg_extra_time_16* pg_fact_loader_16* pg_failover_slots_16* pg_filedump_16* pg_fkpart_16* pg_hint_plan_16* pg_ivm_16* pg_jobmon_16* pg_net_16* pg_partman_16* pg_permissions_16* pg_prioritize_16* pg_profile_16*
- pg_qualstats_16* pg_readonly_16* pg_show_plans_16* pg_squeeze_16* pg_stat_kcache_16* pg_stat_monitor_16* pg_statement_rollback_16* pg_statviz_extension_16 pg_store_plans_16* pgtap_16* pg_tle_16* pg_top_16* pg_track_settings_16* pg_uuidv7_16* pg_wait_sampling_16* pgagent_16* pgaudit_16* pgauditlogtofile_16* pgbouncer_fdw_16* pgcryptokey_16* pgexportdoc_16*
- pldebugger_16* pllua_16* plpgsql_check_16* plprofiler_16* plsh_16* pointcloud_16* postgres-decoderbufs_16* postgresql_anonymizer_16* postgresql_faker_16* powa-archivist_16* powa_16* prefix_16* rum_16 safeupdate_16* semver_16* set_user_16* sqlite_fdw_16* system_stats_16* tdigest_16* tds_fdw_16* temporal_tables_16* timestamp9_16* topn_16* wal2mongo_16*
repo_url_packages:
- https://repo.pigsty.cc/etc/pev.html
- https://repo.pigsty.cc/etc/chart.tgz
Expand Down
4 changes: 2 additions & 2 deletions files/pigsty/ubuntu20.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ all:
pg-meta:
hosts:
10.10.10.10: { pg_seq: 1, pg_role: primary } # <---- primary instance with read-write capability
#10.10.10.x: { pg_seq: 2, pg_role: replica } # <---- read only replica for read-only online traffic
#10.10.10.y: { pg_seq: 3, pg_role: offline } # <---- offline instance of ETL & interactive queries
#x.xx.xx.xx: { pg_seq: 2, pg_role: replica } # <---- read only replica for read-only online traffic
#x.yy.yy.yy: { pg_seq: 3, pg_role: offline } # <---- offline instance of ETL & interactive queries
vars:
pg_cluster: pg-meta # required identity parameter, usually same as group name
pg_conf: oltp.yml # oltp|tiny|olap|crit|... (default: oltp)
Expand Down
4 changes: 2 additions & 2 deletions files/pigsty/ubuntu22.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ all:
pg-meta:
hosts:
10.10.10.10: { pg_seq: 1, pg_role: primary } # <---- primary instance with read-write capability
#10.10.10.x: { pg_seq: 2, pg_role: replica } # <---- read only replica for read-only online traffic
#10.10.10.y: { pg_seq: 3, pg_role: offline } # <---- offline instance of ETL & interactive queries
#x.xx.xx.xx: { pg_seq: 2, pg_role: replica } # <---- read only replica for read-only online traffic
#x.yy.yy.yy: { pg_seq: 3, pg_role: offline } # <---- offline instance of ETL & interactive queries
vars:
pg_cluster: pg-meta # required identity parameter, usually same as group name
pg_conf: oltp.yml # oltp|tiny|olap|crit|... (default: oltp)
Expand Down
4 changes: 2 additions & 2 deletions files/pigsty/wool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
all:
children:

# 建议使用操作系统: RockyLinux 8.8
# 建议使用操作系统: RockyLinux 8.9
# 这里的 10.10.10.10 都应该是你 ECS 的内网 IP 地址,用于安装 Infra/Etcd 模块
infra: { hosts: { 10.10.10.10: { infra_seq: 1 } } }
etcd: { hosts: { 10.10.10.10: { etcd_seq: 1 } }, vars: { etcd_cluster: etcd } }
etcd: { hosts: { 10.10.10.10: { etcd_seq: 1 } }, vars: { etcd_cluster: etcd } }

# 定义一个单节点的 PostgreSQL 数据库实例
pg-meta:
Expand Down
Loading

0 comments on commit 79f747f

Please sign in to comment.