{"id":18501075,"url":"https://github.com/sshnaidm/ironicdev","last_synced_at":"2025-05-14T07:12:09.291Z","repository":{"id":82494013,"uuid":"223433475","full_name":"sshnaidm/ironicdev","owner":"sshnaidm","description":"Ironic Dev and Test quickstart container","archived":false,"fork":false,"pushed_at":"2019-11-24T15:47:35.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-17T01:29:19.475Z","etag":null,"topics":["ironic","openstack","quickstart"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sshnaidm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-22T15:36:30.000Z","updated_at":"2019-11-24T15:47:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"e8a68e5f-b0af-4e0c-8b4f-143728957351","html_url":"https://github.com/sshnaidm/ironicdev","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshnaidm%2Fironicdev","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshnaidm%2Fironicdev/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshnaidm%2Fironicdev/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshnaidm%2Fironicdev/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sshnaidm","download_url":"https://codeload.github.com/sshnaidm/ironicdev/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254092798,"owners_count":22013294,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ironic","openstack","quickstart"],"created_at":"2024-11-06T13:51:49.959Z","updated_at":"2025-05-14T07:12:04.279Z","avatar_url":"https://github.com/sshnaidm.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"Ironic Dev container\n--------------------\n\nSometimes we need to develop Ironic on unprepared environment or need to show\nsomething to newbies or even just run Ironic services to test things locally.\nFor that purpose there is a Ironic Dev container.\nBased on [Developer Quick-Start](https://docs.openstack.org/ironic/latest/contributor/dev-quickstart.html#exercising-the-services-locally)\ndocument I tried to make it as much user friendly as possible. All you need is\njust a container tool. Everything that is mentioned with `podman` here can run\nwith `docker` in the same way with the same parameters.\n\nFor example we need to test some `openstack baremetal` commands and we need a\nrunning Ironic services with fake nodes.\nThis is simple as is:\n\n```bash\npodman run -d --name test_ironic -d -p 6385:6385 sshnaidm/ironicdev\n# or\ndocker run -d --name test_ironic -d -p 6385:6385 sshnaidm/ironicdev\n```\n\nLet's export authentication environment variables for running services:\n```bash\nexport OS_AUTH_TYPE=token_endpoint\nexport OS_TOKEN=fake\nexport OS_ENDPOINT=http://127.0.0.1:6385\n```\nAnd now let's run a `openstack` commands:\n\n```bash\nopenstack baremetal driver list\nopenstack baremetal node list\n```\nIt works! Nothing is displayed because we don't have nodes yet.\nLet's create them.\nWe can go simple way:\n```bash\nFAKE_NODE=$(openstack baremetal node create --driver fake-hardware --management-interface ipmitool --power-interface ipmitool -f value -c uuid)\nopenstack baremetal node show $FAKE_NODE\n```\n\nOr something more complicated:\n\n```bash\nMAC=\"aa:bb:cc:dd:ee:ff\"   # replace with the MAC of a data port on your node\nIPMI_ADDR=\"1.2.3.4\"       # replace with a real IP of the node BMC\nIPMI_USER=\"admin\"         # replace with the BMC's user name\nIPMI_PASS=\"pass\"          # replace with the BMC's password\n\nNODE=$(openstack baremetal node create \\\n       --driver fake-hardware \\\n       --management-interface ipmitool \\\n       --power-interface ipmitool \\\n       --driver-info ipmi_address=$IPMI_ADDR \\\n       --driver-info ipmi_username=$IPMI_USER \\\n       -f value -c uuid)\nopenstack baremetal node set $NODE --driver-info ipmi_password=$IPMI_PASS\nopenstack baremetal port create $MAC --node $NODE\nopenstack baremetal node show $NODE\nopenstack baremetal node validate $NODE\nopenstack baremetal node power on $NODE\n```\nand other commands that you can see in the [Developer Quick-Start](https://docs.openstack.org/ironic/latest/contributor/dev-quickstart.html#exercising-the-services-locally) document.\n\nIf you need to develop locally with prepared Ironic dev container with all services\nrunning inside, you can mount your local sources to sources directory in the container:\n\n```bash\npodman run -d --name ironic -p 6385:6385 -v /path/to/sources/ironic:/src/ironic sshnaidm/ironicdev\n# or\ndocker run -d --name ironic -p 6385:6385 -v /path/to/sources/ironic:/src/ironic sshnaidm/ironicdev\n```\nAfter you changed sources, all you need is just to restart the container to take effect:\n```bash\npodman restart ironic\n# or\ndocker restart ironic\n```\n\nLet's try this. Clone sources to your local directory in ~/sources/ironic\n```bash\ngit clone https://github.com/openstack/ironic ~/sources/ironic\npodman run -d --name ironic -p 6385:6385 -v ~/sources/ironic:/src/ironic sshnaidm/ironicdev\n# check that services are running\npodman logs ironic\n# Let's change log text for example\ncd ironic\nsed -i \"s/RPC create_node called for node/Our new log: RPC create_node called for node/\"  ironic/conductor/manager.py\n# let's add a node\nopenstack baremetal node create --driver fake-hardware --management-interface ipmitool --power-interface ipmitool\npodman logs -f | grep 'Our new log'\n```\nWe see nothing because service still uses an old code.\nLet's restart it:\n```bash\npodman restart ironic\n# to check that service runs\npodman logs\n# if you see SQLAlchemy errors that's fine, schema is already in DB\n# Let's create another node\nopenstack baremetal node create --driver fake-hardware --management-interface ipmitool --power-interface ipmitool\npodman logs -f | grep 'Our new log'\n\n2019-11-22 14:39:51.653 61 DEBUG ironic.conductor.manager [req-e2858b23-5e8a-44de-8f2d-58d92f67e6cf - - - - -] Our new log: RPC create_node called for node dce2237b-233f-40b7-bc93-70e7c368416f. create_node /usr/local/lib/python3.7/site-packages/ironic/conductor/manager.py:131\n```\nVoila! The service is using a new code.\n\nHappy hacking!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsshnaidm%2Fironicdev","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsshnaidm%2Fironicdev","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsshnaidm%2Fironicdev/lists"}