Skip to content
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

fix: display build subtask timing properly regardless of location #161

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ load("//wrksp:python_deps.bzl", "python_deps")
python_deps()
# --end python--

http_archive(
name = "rules_pkg",
urls = [
"https://github.com/bazelbuild/rules_pkg/releases/download/0.10.1/rules_pkg-0.10.1.tar.gz",
],
sha256 = "d250924a2ecc5176808fc4c25d5cf5e9e79e6346d79d5ab1c493e289e722d1d0",
)
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
rules_pkg_dependencies()

http_archive(
name = "com_google_protobuf",
sha256 = "d19643d265b978383352b3143f04c0641eea75a75235c111cc01a1350173180e",
Expand Down
8 changes: 4 additions & 4 deletions ci/resfdeploy.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ local manifestYamlStream = function (value, indent_array_in_object=false, c_docu
image: image,
tag: tag,
};
local istio_mode = if helm_mode then false else if utils.local_image then false else true;
local istio_mode = true; #if helm_mode then false else if utils.local_image then false else true;

{
[nssa]: (if helm_mode then '{{ if not .Values.serviceAccountName }}\n' else '') + manifestYamlStream([
Expand Down Expand Up @@ -248,7 +248,7 @@ local manifestYamlStream = function (value, indent_array_in_object=false, c_docu
'prometheus.io/port': '7332',
}),
volumes: (if std.objectHas(info, 'volumes') then info.volumes(metadata) else []),
ports: std.map(function(x) x { expose: null, external: null }, ports),
ports: [utils.filterObjectFields(port, ['expose']) for port in ports],
health: if std.objectHas(info, 'health') then info.health,
env: env + (if dbname != '' && info.backend then ([dbPassEnv]) else []) + [
{
Expand All @@ -258,7 +258,7 @@ local manifestYamlStream = function (value, indent_array_in_object=false, c_docu
] + [
if std.objectHas(srv, 'expose') && srv.expose then (if helm_mode then {
name: '%s_PUBLIC_URL' % [std.asciiUpper(std.strReplace(std.strReplace(srv.name, stage, ''), '-', '_'))],
value: 'https://{{ .Values.%s.ingressHost }}!!' % [srv.portName],
value: 'https://{{ .Values.%s.ingressHost }}!!' % [srv.name],
} else {
name: '%s_PUBLIC_URL' % [std.asciiUpper(std.strReplace(std.strReplace(srv.name, stage, ''), '-', '_'))],
value: 'https://%s' % mappings.get(srv.name, user),
Expand Down Expand Up @@ -298,7 +298,7 @@ local manifestYamlStream = function (value, indent_array_in_object=false, c_docu
'konghq.com/protocols': (if helm_mode then '{{ .Values.kongProtocols | default !"%ss!" }}' else '%ss') % std.strReplace(std.strReplace(std.strReplace(srv.name, metadata.name, ''), stage, ''), '-', ''),
}
},
host=if helm_mode then '{{ .Values.%s.ingressHost }}' % srv.portName else mappings.get(srv.name, user),
host=if helm_mode then '{{ .Values.%s.ingressHost }}' % srv.name else mappings.get(srv.name, user),
port=srv.port,
srvName=srv.name + '-service',
) else null for srv in services]) +
Expand Down
19 changes: 19 additions & 0 deletions ci/utils.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,23 @@ local stage_no_dash = std.strReplace(stage, '-', '');
stage: stage,
user: user,
stage_no_dash: stage_no_dash,

// Function to filter an object by excluding specified fields.
// Parameters:
// - inputObject: The object to be filtered.
// - fieldsToIgnore: List of fields to be ignored from the input object.
filterObjectFields(inputObject, fieldsToIgnore)::
// Iterating over the fields in the input object and creating a new object
// without the fields specified in `fieldsToIgnore`.
std.foldl(function(filteredObject, currentField)
// If current field is in `fieldsToIgnore`, return the filtered object as is.
// Otherwise, add the current field to the filtered object.
(
if std.member(fieldsToIgnore, currentField) then
filteredObject
else
filteredObject + { [currentField]: inputObject[currentField] }
),
// Starting with an empty object and iterating over each field in the input object.
std.objectFields(inputObject), {}),
}
2 changes: 1 addition & 1 deletion common/frontend_server/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default async function (opts) {
opts.issuerBaseURL.endsWith('.localhost/')) &&
process.env['RESF_ENV']
) {
const kong = 'kong-proxy.kong.svc.cluster.local';
const kong = 'istio-ingressgateway.istio-system.svc.cluster.local';
const urlObject = new URL(opts.issuerBaseURL);
console.warn(`Forcing ${urlObject.hostname} to resolve to ${kong}`);
const lookup = async () => {
Expand Down
18 changes: 18 additions & 0 deletions hack/k3s/pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Pod
metadata:
name: volume-test
spec:
containers:
- name: volume-test
image: nginx:stable-alpine
imagePullPolicy: IfNotPresent
volumeMounts:
- name: volv
mountPath: /data
ports:
- containerPort: 80
volumes:
- name: volv
persistentVolumeClaim:
claimName: local-path-pvc
12 changes: 12 additions & 0 deletions hack/k3s/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: local-path-pvc
namespace: default
spec:
accessModes:
- ReadWriteOnce
storageClassName: local-path
resources:
requests:
storage: 10Gi
7 changes: 4 additions & 3 deletions hack/k8s_dev_pf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT

USER="$(whoami)"
kubectl -n "$USER-dev" port-forward svc/spicedb-dev-grpc-dev-service 50051 &
kubectl -n "$USER-dev" port-forward svc/hydra-admin-dev-http-dev-service 4445 &
kubectl -n "$USER-dev" port-forward svc/hydra-public-dev-http-dev-service 4444
kubectl -n "$USER-dev" port-forward svc/spicedb-grpc-dev-service 50051 &
kubectl -n "$USER-dev" port-forward svc/hydra-admin-http-dev-service 4445 &
kubectl -n "$USER-dev" port-forward svc/hydra-public-http-dev-service 4444 &
sudo kubectl --kubeconfig $KUBECONFIG -n "istio-system" port-forward --address 0.0.0.0 deployment/istio-ingressgateway 80:8080 443:8443
11 changes: 6 additions & 5 deletions hack/setup_dev_temporal
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,20 @@ fi

cd "$DIR_TO_TEMPORAL" || exit 1

export SQL_PLUGIN=postgres
export SQL_PLUGIN=postgres12
export SQL_HOST=localhost
export SQL_PORT=$POSTGRES_PORT
export SQL_USER=postgres
export SQL_PASSWORD=postgres

./temporal-sql-tool create-database -database temporal
./temporal-sql-tool -database temporal create-database
./temporal-sql-tool -database temporal_visibility create-database

SQL_DATABASE=temporal ./temporal-sql-tool setup-schema -v 0.0
SQL_DATABASE=temporal ./temporal-sql-tool update -schema-dir schema/postgresql/v96/temporal/versioned
SQL_DATABASE=temporal ./temporal-sql-tool update -schema-dir schema/postgresql/v12/temporal/versioned

./temporal-sql-tool create-database -database temporal_visibility
SQL_DATABASE=temporal_visibility ./temporal-sql-tool setup-schema -v 0.0
SQL_DATABASE=temporal_visibility ./temporal-sql-tool update -schema-dir schema/postgresql/v96/visibility/versioned
SQL_DATABASE=temporal_visibility ./temporal-sql-tool update -schema-dir schema/postgresql/v12/visibility/versioned

sleep 10

Expand Down
4 changes: 2 additions & 2 deletions hack/setup_external_dev_services
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

# TODO: Setup an bash error trap, to make errors from failing commands more
# visible and draw attention of the user to these errors.
source .envrc.local

# Install postgres
helm repo add bitnami https://charts.bitnami.com/bitnami
Expand All @@ -45,8 +46,7 @@ helm repo add bitnami https://charts.bitnami.com/bitnami
# and places a PersisentVolumeClaim for this.
# Ensure that the cluster provides PersistentVolumes:

if kubectl get PersistentVolume -o json
| jq -e '.items | .[].status | select(.phase == "Bound")' ; then
if kubectl get PersistentVolume -o json | jq -e '.items | .[].status | select(.phase == "Bound")' ; then
echo "Ok found at least one PersistentVolume"
else
echo "The postgresql helm chart has a PersistentVolumeClaim (PVC)."
Expand Down
1 change: 1 addition & 0 deletions hydra/deploy/admin/deploy.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ resfdeploy.new({
name: 'http',
containerPort: 4445,
protocol: 'TCP',
expose: true,
},
],
health: {
Expand Down
2 changes: 1 addition & 1 deletion hydra/deploy/common.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local utils = import 'ci/utils.jsonnet';
local tag = std.extVar('tag');

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

{
image: 'oryd/hydra',
Expand Down
4 changes: 2 additions & 2 deletions hydra/pkg/hydra/autosignup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function hydraPublicUrl() {
if (process.env['HYDRA_PUBLIC_URL']) {
return process.env['HYDRA_PUBLIC_URL'];
}
return 'https://hdr-dev.internal.rdev.ciq.localhost';
return 'https://hdr-dev.internal.pdev.resf.localhost';
}
const svc = svcNameHttp('hydra-public');
return endpointHttp(svc, NS('hydra-public'), ':4444');
Expand All @@ -59,7 +59,7 @@ export function hydraPublicUrl() {
function hydraAdminUrl() {
return envOverridable('hydra_admin', 'http', () => {
if (!process.env['RESF_ENV']) {
return 'https://hdr-admin-dev.internal.rdev.ciq.localhost';
return 'https://hdr-admin-dev.internal.pdev.resf.localhost';
}
const svc = svcNameHttp('hydra-admin');
return endpointHttp(svc, NS('hydra-admin'), ':4445');
Expand Down
6 changes: 3 additions & 3 deletions infrastructure/dev-helm/temporal/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies:
condition: prometheus.enabled
- name: elasticsearch
repository: https://helm.elastic.co
version: 7.16.3
version: 7.17.3
condition: elasticsearch.enabled
- name: grafana
repository: https://grafana.github.io/helm-charts
Expand All @@ -49,8 +49,8 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 0.15.2
version: 0.33.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 1.15.2
appVersion: 1.22.4
23 changes: 0 additions & 23 deletions infrastructure/dev-helm/temporal/LICENSE

This file was deleted.

Loading