-
Notifications
You must be signed in to change notification settings - Fork 145
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
chore: initial Tiltfile #3412
Merged
Merged
chore: initial Tiltfile #3412
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8f0f787
chore: initial Tiltfile
bodymindarts 86cb4de
chore: add lnd1 to Tiltfile
bodymindarts ee64b8e
chore: add core api to Tiltfile
bodymindarts cb32262
chore: add serve_env to api
bodymindarts 6f5ae95
chore: add auth deps to Tiltfile
bodymindarts de79369
chore: run consent test in tilt
bodymindarts 2730d3b
build: add xvfb-run to tilt
bodymindarts 6c7c422
fix: bring back .env
bodymindarts 058bff6
ci: fix --test opt in tilt.yml
bodymindarts b829347
ci: pass labels to tilt
bodymindarts File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: "Tilt CI" | ||
on: | ||
pull_request: | ||
branches: [ main ] | ||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: cachix/install-nix-action@v22 | ||
with: | ||
github_access_token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Tilt CI | ||
run: nix develop -c bash -c "cd dev && xvfb-run tilt ci -- --test consent" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.*.json | ||
.*.env | ||
.envs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,148 @@ | ||
is_ci=sys.argv[1] == "ci" | ||
|
||
config.define_string_list("test") | ||
cfg = config.parse() | ||
|
||
groups = { | ||
"auth": [ | ||
"oathkeeper", | ||
"hydra", | ||
"hydra-migrate", | ||
"hydra-pg", | ||
"kratos", | ||
"kratos-pg", | ||
], | ||
"core": [ | ||
"apollo-router", | ||
"mongodb", | ||
"redis", | ||
], | ||
"bitcoin": [ | ||
"lnd1", | ||
"bria", | ||
"postgres-bria", | ||
"fulcrum", | ||
"bitcoind-signer", | ||
"bitcoind", | ||
], | ||
"tracing": [ | ||
"otel-agent", | ||
], | ||
} | ||
|
||
consent_test_target = "//apps/consent:cypress" | ||
local_resource( | ||
"consent-test", | ||
labels = ["test"], | ||
auto_init = is_ci and "consent" in cfg.get("test", []), | ||
cmd = "buck2 test {}".format(consent_test_target), | ||
resource_deps = [ | ||
"consent", | ||
"init-test-user", | ||
"hydra-consent" | ||
], | ||
) | ||
|
||
local_resource( | ||
name='init-test-user', | ||
labels = ['test'], | ||
cmd='bin/init-user.sh', | ||
resource_deps = [ | ||
"oathkeeper", | ||
"kratos", | ||
"api", | ||
] | ||
) | ||
|
||
consent_target = "//apps/consent:dev" | ||
if is_ci: | ||
consent_target = '//apps/consent:consent' | ||
local_resource( | ||
"consent", | ||
labels = ["auth"], | ||
cmd = "buck2 build {}".format(consent_target), | ||
serve_cmd = "buck2 run {}".format(consent_target), | ||
resource_deps = [ | ||
"apollo-router", | ||
"hydra", | ||
"api", | ||
], | ||
links = [ | ||
link("http://localhost:3000", "consent"), | ||
], | ||
) | ||
|
||
local_resource( | ||
name='hydra-consent', | ||
labels = ['auth'], | ||
cmd=['bin/setup-hydra-client.sh', 'consent', 'http://localhost:3000'], | ||
resource_deps = [ | ||
"hydra", | ||
] | ||
) | ||
|
||
api_target = "//core/api:api" | ||
local_resource( | ||
"api", | ||
labels = ["frontend"], | ||
labels = ["core"], | ||
cmd = "buck2 build {}".format(api_target), | ||
serve_cmd = "buck2 run {}".format(api_target), | ||
serve_env = { | ||
"HELMREVISION": "dev", | ||
"NETWORK": "regtest", | ||
"OATHKEEPER_DECISION_ENDPOINT": "http://localhost:4456", | ||
"TWILIO_ACCOUNT_SID": "AC_twilio_id", | ||
"TWILIO_AUTH_TOKEN": "AC_twilio_auth_token", | ||
"TWILIO_VERIFY_SERVICE_ID": "VA_twilio_service", | ||
"KRATOS_PG_CON": "postgres://dbuser:secret@localhost:5433/default?sslmode=disable", | ||
"KRATOS_PUBLIC_API": "http://localhost:4433", | ||
"KRATOS_ADMIN_API": "http://localhost:4434", | ||
"KRATOS_MASTER_USER_PASSWORD": "passwordHardtoFindWithNumber123", | ||
"KRATOS_CALLBACK_API_KEY": "The-Value-of-My-Key", | ||
"BRIA_HOST": "localhost", | ||
"BRIA_API_KEY": "bria_dev_000000000000000000000", | ||
"MONGODB_CON": "mongodb://localhost:27017/galoy", | ||
"REDIS_MASTER_NAME": "mymaster", | ||
"REDIS_PASSWORD": "", | ||
"REDIS_0_DNS": "localhost", | ||
"REDIS_0_PORT": "6379", | ||
"REDIS_TYPE": "standalone", | ||
"UNSECURE_IP_FROM_REQUEST_OBJECT": "true", | ||
"UNSECURE_DEFAULT_LOGIN_CODE": "000000", | ||
"GEETEST_ID": "geetest_id", | ||
"GEETEST_KEY": "geetest_key" | ||
}, | ||
allow_parallel = True, | ||
readiness_probe = probe( | ||
period_secs = 5, | ||
http_get = http_get_action( | ||
path = "healthz", | ||
port = 4012, | ||
), | ||
), | ||
resource_deps = [ | ||
"init-onchain", | ||
"lnd1", | ||
] | ||
) | ||
|
||
local_resource( | ||
name='init-onchain', | ||
labels = ['bitcoin'], | ||
cmd='bin/init-onchain.sh', | ||
resource_deps = [ | ||
"bitcoind", | ||
"bria", | ||
] | ||
) | ||
|
||
docker_compose("./docker-compose.deps.yml", project_name = "galoy-dev") | ||
|
||
for service in groups["bitcoin"]: | ||
dc_resource(service, labels = ["bitcoin"]) | ||
for service in groups["tracing"]: | ||
dc_resource(service, labels = ["tracing"]) | ||
for service in groups["core"]: | ||
dc_resource(service, labels = ["core"]) | ||
for service in groups["auth"]: | ||
dc_resource(service, labels = ["auth"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
DEV_DIR="$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")" | ||
source "${DEV_DIR}/helpers/cli.sh" | ||
|
||
echo "Seeding some regtest blocks..." | ||
|
||
bitcoin_cli createwallet "outside" || true | ||
bitcoin_cli -generate 200 > /dev/null 2>&1 | ||
|
||
bitcoin_signer_cli createwallet "dev" || true | ||
bitcoin_signer_cli -rpcwallet=dev importdescriptors "$(cat ./config/bitcoind/bitcoind_signer_descriptors.json)" | ||
|
||
echo "Checking that bria is running..." | ||
|
||
for _ in {1..20}; do | ||
bria_cli wallet-balance -w dev-wallet && break | ||
sleep 1 | ||
done | ||
bria_cli wallet-balance -w dev-wallet || exit 1 | ||
|
||
echo "DONE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
set -x | ||
|
||
DEV_DIR="$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")" | ||
source "${DEV_DIR}/helpers/auth.sh" | ||
source "${DEV_DIR}/helpers/gql.sh" | ||
|
||
user_phone="+16505554350" | ||
email="test@galoy.com" | ||
|
||
auth_token="$(login_user "${user_phone}")" | ||
|
||
register_email_to_user "${auth_token}" "${email}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
DEV_DIR="$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")" | ||
source "${DEV_DIR}/helpers/cli.sh" | ||
|
||
hydra_client_name="${1}" | ||
redirect_uri="${2}" | ||
|
||
HYDRA_CLIENT_JSON="${DEV_DIR}/../.${hydra_client_name}-hydra-client.json" | ||
HYDRA_CLIENT_ENV="${DEV_DIR}/../.${hydra_client_name}-hydra-client.env" | ||
HYDRA_ADMIN_API="http://localhost:4445" | ||
HYDRA_PUBLIC_API="http://localhost:4444" | ||
|
||
hydra_cli create client \ | ||
--endpoint "${HYDRA_ADMIN_API}" \ | ||
--grant-type authorization_code,refresh_token \ | ||
--response-type code,id_token \ | ||
--format json \ | ||
--scope offline --scope transactions:read --scope payments:send \ | ||
--redirect-uri "$redirect_uri" > "${HYDRA_CLIENT_JSON}" | ||
|
||
CLIENT_ID=$(jq -r '.client_id' < "${HYDRA_CLIENT_JSON}") | ||
CLIENT_SECRET=$(jq -r '.client_secret' < "${HYDRA_CLIENT_JSON}") | ||
|
||
AUTHORIZATION_URL="${HYDRA_PUBLIC_API}/oauth2/auth?client_id=$CLIENT_ID&scope=offline%20transactions:read&response_type=code&redirect_uri=$redirect_uri&state=kfISr3GhH0rqheByU6A6hqIG_f14pCGkZLSCUTHnvlI" | ||
|
||
echo "export CLIENT_ID=$CLIENT_ID" > "${HYDRA_CLIENT_ENV}" | ||
echo "export CLIENT_SECRET=$CLIENT_SECRET" >> "${HYDRA_CLIENT_ENV}" | ||
echo "export AUTHORIZATION_URL=$AUTHORIZATION_URL" >> "${HYDRA_CLIENT_ENV}" | ||
|
||
mkdir -p "${DEV_DIR}/.envs" | ||
cp "${HYDRA_CLIENT_ENV}" "${DEV_DIR}/.envs/${hydra_client_name}.env" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
rpcuser=rpcuser | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the intention to eventually remove these files from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
rpcpassword=rpcpassword | ||
debug=mempool | ||
debug=rpc | ||
server=1 | ||
txindex=1 | ||
printtoconsole=1 | ||
zmqpubrawtx=tcp://0.0.0.0:28333 | ||
zmqpubrawblock=tcp://0.0.0.0:28332 | ||
blockfilterindex=1 | ||
bind=0.0.0.0 | ||
fallbackfee=0.0002 | ||
rpcallowip=0.0.0.0/0 | ||
regtest=1 | ||
[regtest] | ||
bind=0.0.0.0 | ||
fallbackfee=0.0002 | ||
rpcallowip=0.0.0.0/0 | ||
rpcbind=0.0.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"active":true,"desc":"wpkh([6f2fa1b2/84'/0'/0']tprv8gXB88g1VCScmqPp8WcetpJPRxix24fRJJ6FniYCcCUEFMREDrCfwd34zWXPiY5MW2xp8e1Z6EeBrh74zMSgfQQmTorWtE1zyBtv7yxdcoa/0/*)#88k4937c","timestamp":0},{"active":true,"desc":"wpkh([6f2fa1b2/84'/0'/0']tprv8gXB88g1VCScmqPp8WcetpJPRxix24fRJJ6FniYCcCUEFMREDrCfwd34zWXPiY5MW2xp8e1Z6EeBrh74zMSgfQQmTorWtE1zyBtv7yxdcoa/1/*)#knn5cywq","internal":true,"timestamp":0}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
app: | ||
blockchain: | ||
network: regtest | ||
electrum_url: fulcrum:50001 | ||
tracing: | ||
host: "otel-agent" | ||
port: 4318 | ||
service_name: "bria-dev" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
bitcoind = bitcoind:18443 | ||
rpcuser = rpcuser | ||
rpcpassword = rpcpassword | ||
peering = false | ||
announce = false | ||
tcp = 0.0.0.0:50001 | ||
ssl = 0.0.0.0:50002 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIDBTCCAe2gAwIBAgIUKCSR4otDtA4+ow5z5zL9zc1CI10wDQYJKoZIhvcNAQEL | ||
BQAwEjEQMA4GA1UECgwHRnVsY3J1bTAeFw0yMjExMjkxMDUzNDFaFw0zMjExMjYx | ||
MDUzNDFaMBIxEDAOBgNVBAoMB0Z1bGNydW0wggEiMA0GCSqGSIb3DQEBAQUAA4IB | ||
DwAwggEKAoIBAQDasNdsbz47BDEjzKLeG4RxOqMikrBY6fQd0+8pt8Fh/qSaF2lG | ||
NpLbADDcszyddb0GD5tYQe7YBIyrexp9Q1gvejj1zuagXwlSYfrSkiDB3nBYreSl | ||
wq4i87VjCMX5Fr270S3mHfptg5zbPgQvvTvnD0Y7Ur9lriNydWp9Qz6TLWWYVhui | ||
yxLrtsxv6hRDndlkIxDbZt9kr6yzLroBtXFEFSCeROb1sE2ouVXC89eAlcpvWZF6 | ||
MMnlAkECRS5m3QtKyYtTQ0FTGBrAN2xUnirR9z+wpAOu3S/AjEt4AC1ome75tiJv | ||
rtCIaf438QhNerb/sQmyHXIpjw6KZxADKS3RAgMBAAGjUzBRMB0GA1UdDgQWBBS0 | ||
xHEskJjxCg8F1YYT0NkzBVFsTDAfBgNVHSMEGDAWgBS0xHEskJjxCg8F1YYT0Nkz | ||
BVFsTDAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQCwxhxRCfa1 | ||
DXfFP+BM9OwDldNC9B66d/6hueaY26YJxcLvuKcAm+0MwciNFnWhb9yiY2wnWaZ6 | ||
zA6VKuxCrVU7egg5gG2+lZYjAiQOkFtVNHGEIjVTow4GJAkJGjH/B9J2teHKR1a6 | ||
XDJ5xKLAIM7hnKVjIM7cA/Y3Q/AsR/uzp4GOccqHX3g/AKKLFahLCkVv5CeIrl+y | ||
kPv/3jXbP71iJPhG2j74EVPLeQ0qKAb03vz2Y2HaSBripGQEwnx7MoQnbRhYx00Y | ||
+LG1WGYeNOEXfT8trewl+gfsoLenlDTLukIfjjvQ5dRDA9pD1ij+1+jz/XCyQ7w5 | ||
LzhYnJBwIGpt | ||
-----END CERTIFICATE----- |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it make to look into terraform so we have some parity with prod, instead of having a script? or that would not make sense for dev?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO too much overhead to bring in another tool for dev.