Skip to content

Commit dd543e3

Browse files
committed
WIP: various updates to enable development
1 parent ec3e03c commit dd543e3

File tree

10 files changed

+43
-13
lines changed

10 files changed

+43
-13
lines changed

WORKSPACE

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ load("//wrksp:python_deps.bzl", "python_deps")
2424
python_deps()
2525
# --end python--
2626

27+
http_archive(
28+
name = "rules_pkg",
29+
urls = [
30+
"https://github.com/bazelbuild/rules_pkg/releases/download/0.10.1/rules_pkg-0.10.1.tar.gz",
31+
],
32+
sha256 = "d250924a2ecc5176808fc4c25d5cf5e9e79e6346d79d5ab1c493e289e722d1d0",
33+
)
34+
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
35+
rules_pkg_dependencies()
36+
2737
http_archive(
2838
name = "com_google_protobuf",
2939
sha256 = "d19643d265b978383352b3143f04c0641eea75a75235c111cc01a1350173180e",

ci/resfdeploy.jsonnet

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ local manifestYamlStream = function (value, indent_array_in_object=false, c_docu
6363
protocol: 'TCP',
6464
}]);
6565
local services = if std.objectHas(info, 'services') then info.services else
66-
[{ name: '%s-%s-%s' % [metadata.name, port.name, env], port: port.containerPort, portName: port.name, expose: if std.objectHas(port, 'expose') then port.expose else false } for env in envs for port in ports];
66+
[{ name: '%s-%s-%s' % [metadata.name, port.name, env], port: port.containerPort, expose: if std.objectHas(port, 'expose') then port.expose else false } for env in envs for port in ports];
6767

6868
local file_yaml_prefix = if helm_mode then 'helm-' else '';
6969
local nssa = '%s001-ns-sa.yaml' % file_yaml_prefix;
@@ -109,7 +109,7 @@ local manifestYamlStream = function (value, indent_array_in_object=false, c_docu
109109
image: image,
110110
tag: tag,
111111
};
112-
local istio_mode = if helm_mode then false else if utils.local_image then false else true;
112+
local istio_mode = true; #if helm_mode then false else if utils.local_image then false else true;
113113

114114
{
115115
[nssa]: (if helm_mode then '{{ if not .Values.serviceAccountName }}\n' else '') + manifestYamlStream([
@@ -248,7 +248,7 @@ local manifestYamlStream = function (value, indent_array_in_object=false, c_docu
248248
'prometheus.io/port': '7332',
249249
}),
250250
volumes: (if std.objectHas(info, 'volumes') then info.volumes(metadata) else []),
251-
ports: std.map(function(x) x { expose: null, external: null }, ports),
251+
ports: [utils.filterObjectFields(port, ['expose']) for port in ports],
252252
health: if std.objectHas(info, 'health') then info.health,
253253
env: env + (if dbname != '' && info.backend then ([dbPassEnv]) else []) + [
254254
{
@@ -258,7 +258,7 @@ local manifestYamlStream = function (value, indent_array_in_object=false, c_docu
258258
] + [
259259
if std.objectHas(srv, 'expose') && srv.expose then (if helm_mode then {
260260
name: '%s_PUBLIC_URL' % [std.asciiUpper(std.strReplace(std.strReplace(srv.name, stage, ''), '-', '_'))],
261-
value: 'https://{{ .Values.%s.ingressHost }}!!' % [srv.portName],
261+
value: 'https://{{ .Values.%s.ingressHost }}!!' % [srv.name],
262262
} else {
263263
name: '%s_PUBLIC_URL' % [std.asciiUpper(std.strReplace(std.strReplace(srv.name, stage, ''), '-', '_'))],
264264
value: 'https://%s' % mappings.get(srv.name, user),
@@ -283,7 +283,6 @@ local manifestYamlStream = function (value, indent_array_in_object=false, c_docu
283283
},
284284
srv.port,
285285
srv.port,
286-
portName=srv.portName,
287286
selector=metadata.name,
288287
env=mappings.get_env_from_svc(srv.name)
289288
) for srv in services]) +
@@ -298,7 +297,7 @@ local manifestYamlStream = function (value, indent_array_in_object=false, c_docu
298297
'konghq.com/protocols': (if helm_mode then '{{ .Values.kongProtocols | default !"%ss!" }}' else '%ss') % std.strReplace(std.strReplace(std.strReplace(srv.name, metadata.name, ''), stage, ''), '-', ''),
299298
}
300299
},
301-
host=if helm_mode then '{{ .Values.%s.ingressHost }}' % srv.portName else mappings.get(srv.name, user),
300+
host=if helm_mode then '{{ .Values.%s.ingressHost }}' % srv.name else mappings.get(srv.name, user),
302301
port=srv.port,
303302
srvName=srv.name + '-service',
304303
) else null for srv in services]) +

ci/utils.jsonnet

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,23 @@ local stage_no_dash = std.strReplace(stage, '-', '');
1818
stage: stage,
1919
user: user,
2020
stage_no_dash: stage_no_dash,
21+
22+
// Function to filter an object by excluding specified fields.
23+
// Parameters:
24+
// - inputObject: The object to be filtered.
25+
// - fieldsToIgnore: List of fields to be ignored from the input object.
26+
filterObjectFields(inputObject, fieldsToIgnore)::
27+
// Iterating over the fields in the input object and creating a new object
28+
// without the fields specified in `fieldsToIgnore`.
29+
std.foldl(function(filteredObject, currentField)
30+
// If current field is in `fieldsToIgnore`, return the filtered object as is.
31+
// Otherwise, add the current field to the filtered object.
32+
(
33+
if std.member(fieldsToIgnore, currentField) then
34+
filteredObject
35+
else
36+
filteredObject + { [currentField]: inputObject[currentField] }
37+
),
38+
// Starting with an empty object and iterating over each field in the input object.
39+
std.objectFields(inputObject), {}),
2140
}

common/frontend_server/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export default async function (opts) {
9191
opts.issuerBaseURL.endsWith('.localhost/')) &&
9292
process.env['RESF_ENV']
9393
) {
94-
const kong = 'kong-proxy.kong.svc.cluster.local';
94+
const kong = 'istio-ingressgateway.istio-system.svc.cluster.local';
9595
const urlObject = new URL(opts.issuerBaseURL);
9696
console.warn(`Forcing ${urlObject.hostname} to resolve to ${kong}`);
9797
const lookup = async () => {

hydra/deploy/common.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ local utils = import 'ci/utils.jsonnet';
55
local tag = std.extVar('tag');
66

77
local DSN = db.dsn('hydra');
8-
local authn = if kubernetes.prod() then 'https://id.build.resf.org' else 'http://obsidian.pdot.localhost:16000';
8+
local authn = if kubernetes.prod() then 'https://id.build.resf.org' else 'https://id-dev.internal.pdev.resf.localhost';
99

1010
{
1111
image: 'oryd/hydra',

hydra/pkg/hydra/autosignup.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export function hydraPublicUrl() {
4949
if (process.env['HYDRA_PUBLIC_URL']) {
5050
return process.env['HYDRA_PUBLIC_URL'];
5151
}
52-
return 'https://hdr-dev.internal.rdev.ciq.localhost';
52+
return 'https://hdr-dev.internal.pdev.resf.localhost';
5353
}
5454
const svc = svcNameHttp('hydra-public');
5555
return endpointHttp(svc, NS('hydra-public'), ':4444');
@@ -59,7 +59,7 @@ export function hydraPublicUrl() {
5959
function hydraAdminUrl() {
6060
return envOverridable('hydra_admin', 'http', () => {
6161
if (!process.env['RESF_ENV']) {
62-
return 'https://hdr-admin-dev.internal.rdev.ciq.localhost';
62+
return 'https://hdr-admin-dev.internal.pdev.resf.localhost';
6363
}
6464
const svc = svcNameHttp('hydra-admin');
6565
return endpointHttp(svc, NS('hydra-admin'), ':4445');

infrastructure/istio-dev/istio-base-gateway.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ spec:
1313
protocol: HTTP
1414
hosts:
1515
- "*.pdev.resf.localhost"
16+
- "*.pdev.resf.local"
1617
tls:
1718
httpsRedirect: true
1819
- port:
@@ -21,6 +22,7 @@ spec:
2122
protocol: HTTPS
2223
hosts:
2324
- "*.pdev.resf.localhost"
25+
- "*.pdev.resf.local"
2426
tls:
2527
mode: SIMPLE
2628
credentialName: default-cert

obsidian/ui/server/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import {
4040
} from '../../../common/frontend_server/upstream.mjs';
4141

4242
export default async function run(webpackConfig) {
43-
const devFrontendUrl = 'http://obsidian.pdot.localhost:16000';
43+
const devFrontendUrl = 'https://id-dev.internal.pdev.resf.localhost';
4444
const envPublicUrl = process.env['OBSIDIAN_FRONTEND_HTTP_PUBLIC_URL'];
4545
const frontendUrl = process.env['RESF_NS'] ? envPublicUrl : devFrontendUrl;
4646

rules_resf/internal/container/container.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
1+
load("@rules_pkg//:pkg.bzl", "pkg_tar")
22
load("@io_bazel_rules_docker//container:container.bzl", "container_image", "container_layer", "container_push")
33
load("@io_bazel_rules_docker//nodejs:image.bzl", "nodejs_image")
44

wrksp/python_download.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
33
def python_download():
44
http_archive(
55
name = "rules_python",
6-
url = "https://github.com/bazelbuild/rules_python/releases/download/0.2.0/rules_python-0.2.0.tar.gz",
6+
url = "https://github.com/bazelbuild/rules_python/releases/download/0.31.0/rules_python-0.2.0.tar.gz",
77
sha256 = "778197e26c5fbeb07ac2a2c5ae405b30f6cb7ad1f5510ea6fdac03bded96cc6f",
88
)

0 commit comments

Comments
 (0)