Skip to content

Instantly share code, notes, and snippets.

View LalatenduMohanty's full-sized avatar
💭
I may be slow to respond.

Lalatendu Mohanty LalatenduMohanty

💭
I may be slow to respond.
View GitHub Profile
@LalatenduMohanty
LalatenduMohanty / gist:762baf9999a09ef3d2d3e63220b9c52e
Last active August 22, 2025 06:30
Command prompt for creating the code for --test-mode
# Fromager --test-mode Implementation - Exact Conversation Transcript
## Initial User Request
**User**: Introduce a test-mode ( a cli flag) to the bootstrap command. it should build packages similar to an usual bootstrap command. However if it fails to build a package it should should mark it as pre-built and rerun the bootstrap. It should continue doing it till it goes through all the packages. At the end the command should produce a list of the packages with build failures and exit with an error code indicating that the build did not succeed. Use existing code patterens in the repo to write this code. Also do not write the tests.
**Assistant**: I'll implement the `--test-mode` CLI flag for the bootstrap command that handles build failures by marking failed packages as pre-built and continuing the process. Let me analyze the existing code structure and implement this feature.
[Assistant created todo list and implemented the test mode with multiple code changes to src/fromager/commands/bootstrap.py]
**Ass
@LalatenduMohanty
LalatenduMohanty / Dockerfile
Created August 21, 2024 18:53 — forked from aojea/Dockerfile
Using crio runtime in KIND
ARG IMAGE=kindest/node
ARG VERSION=1.19
ARG MINOR=1
ARG OS=xUbuntu_20.04
FROM ${IMAGE}:v${VERSION}.${MINOR}
ARG VERSION
ARG OS
curl --silent --header 'Accept:application/json' 'https://api.openshift.com/api/upgrades_info/v1/graph?arch=amd64&channel=candidate-4.8' | jq '. as $graph | $graph.nodes | map(.version == "4.8.7") | index(true) as $orig | $graph.edges | map(select(.[0] == $orig)[1]) | map($graph.nodes[.])'
[
{
"version": "4.8.28",
"payload": "quay.io/openshift-release-dev/ocp-release@sha256:ba1299680b542e46744307afc7effc15957a20592d88de4651610b52ed8be9a8",
"metadata": {
"io.openshift.upgrades.graph.release.channels": "eus-4.10,candidate-4.8,eus-4.8,fast-4.8,stable-4.8,candidate-4.9,fast-4.9,stable-4.9",
"io.openshift.upgrades.graph.release.manifestref": "sha256:ba1299680b542e46744307afc7effc15957a20592d88de4651610b52ed8be9a8",
"url": "https://access.redhat.com/errata/RHBA-2022:0172"
}
@LalatenduMohanty
LalatenduMohanty / replace-cluster-cvo.sh
Created October 27, 2022 20:30 — forked from petr-muller/replace-cluster-cvo.sh
Hotswap CVO in a running cluster
#!/bin/bash
set -eu
root="$(dirname "${BASH_SOURCE[0]}")/.."
customCvoPullspec=quay.io/petr-muller/cluster-version-operator:"$(git branch --show-current)"
payload="$(oc get -n openshift-cluster-version clusterversion version -o jsonpath='{.status.desired.image}')"
podman pull "$payload"
$ oc get nodes -o yaml
apiVersion: v1
items:
- apiVersion: v1
kind: Node
metadata:
annotations:
csi.volume.kubernetes.io/nodeid: '{"pd.csi.storage.gke.io":"projects/openshift-gce-devel-ci/zones/us-central1-a/instances/ci-ln-sbbj2q2-f76d1-bh8mc-master-0"}'
machine.openshift.io/machine: openshift-machine-api/ci-ln-sbbj2q2-f76d1-bh8mc-master-0
machineconfiguration.openshift.io/currentConfig: rendered-master-d9ead9f63bf2dbd577f8508f4a7df772
I0701 11:41:49.366756 398972 config.go:128] looking for config.json at /home/lmohanty/.docker/config.json
I0701 11:41:49.366850 398972 config.go:136] found valid config.json at /home/lmohanty/.docker/config.json
I0701 11:41:49.367006 398972 round_trippers.go:425] curl -k -v -XGET 'https://quay.io/v2/'
I0701 11:41:49.580915 398972 round_trippers.go:445] GET https://quay.io/v2/ 401 Unauthorized in 213 milliseconds
I0701 11:41:49.580948 398972 round_trippers.go:451] Response Headers:
I0701 11:41:49.580957 398972 round_trippers.go:454] Www-Authenticate: Bearer realm="https://quay.io/v2/auth",service="quay.io"
I0701 11:41:49.580971 398972 round_trippers.go:454] Server: nginx/1.12.1
I0701 11:41:49.580978 398972 round_trippers.go:454] Date: Thu, 01 Jul 2021 15:41:49 GMT
I0701 11:41:49.580987 398972 round_trippers.go:454] Content-Type: text/html; charset=utf-8
I0701 11:41:49.580996 398972 round_trippers.go:454] Content-Length: 4
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfigPool
metadata:
creationTimestamp: "2021-06-25T18:32:03Z"
generation: 2
managedFields:
- apiVersion: machineconfiguration.openshift.io/v1
fieldsType: FieldsV1
fieldsV1:
f:spec:
@LalatenduMohanty
LalatenduMohanty / pr.md
Created June 15, 2021 16:14 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

$ make func-test
Deploying Update Service operator
hack/deploy.sh
namespace/openshift-updateservice created
serviceaccount/updateservice-operator created
clusterrole.rbac.authorization.k8s.io/updateservice-operator created
rolebinding.rbac.authorization.k8s.io/updateservice-operator created
clusterrolebinding.rbac.authorization.k8s.io/updateservice-operator created
service/updateservice-operator-metrics created
2021-04-19T15:00:26.018Z INFO cmd Operator Version: 777fadbe-dirty
2021-04-19T15:00:26.018Z INFO cmd Go Version: go1.15.7
2021-04-19T15:00:26.018Z INFO cmd Go OS/Arch: linux/amd64
I0419 15:00:27.069591 1 request.go:645] Throttling request took 1.036656648s, request: GET:https://172.30.0.1:443/apis/machine.openshift.io/v1beta1?timeout=32s
2021-04-19T15:00:28.438Z INFO controller-runtime.metrics metrics server is starting to listen {"addr": ":8080"}
2021-04-19T15:00:28.438Z INFO cmd Starting the Cmd.
2021-04-19T15:00:28.439Z INFO controller-runtime.manager starting metrics server {"path": "/metrics"}
2021-04-19T15:00:28.439Z INFO controller Starting EventSource {"reconcilerGroup": "updateservice.operator.openshift.io", "reconcilerKind": "UpdateService", "controller": "updateservice", "source": "kind source: /, Kind="}
2021-04-19T15:00:28.539Z INFO controller Starting EventSource {"reconcilerGroup": "updateservice.operator.openshift.io", "reconcilerKind": "UpdateService", "controller": "updateservice", "so