Skip to content

Commit

Permalink
use external config and network files and some improvments
Browse files Browse the repository at this point in the history
Signed-off-by: Mohammed Boukhalfa <[email protected]>
  • Loading branch information
mboukhalfa committed Aug 30, 2024
1 parent 4e42ef5 commit fa61478
Show file tree
Hide file tree
Showing 27 changed files with 32 additions and 403 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
MANIFEST
11 changes: 5 additions & 6 deletions fake-ipa/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
ARG BASE_IMAGE=python:3.9-slim
FROM $BASE_IMAGE
ENV PBR_VERSION=6.0.0
COPY . /root/fake-ipa/
WORKDIR /root/fake-ipa/
ENV CONFIG ${CONFIG:-/root/fake-ipa/conf.py}
RUN python3 -m pip install -r requirements.txt
RUN python3 setup.py install
CMD fake-ipa --config $CONFIG
COPY . /app/
WORKDIR /app/
ENV CONFIG ${CONFIG:-/app/conf.py}
RUN python3 -m pip install . -r requirements.txt
CMD fake-ipa --config "${CONFIG}"
47 changes: 9 additions & 38 deletions fake-ipa/README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,19 @@
# Fake ironic python agent
# Fake Ironic Python Agent

Fake ipa is a tool to help test ironic communication with IPA.
FakeIPA is a tool to help test ironic communication with IPA.

Fake ipa simulate the IPA by:
FakeIPA simulate the IPA by:

- Running an API server with the needed real IPA endpoint.
- Send back fake inspection data when requested.
- lookup the node and save tokens.
- Heartbeating to ironic API with several threads looping over
- Lookup the node and save tokens.
- Heartbeating to Ironic API with several threads looping over
a queue of fake agents.
- Faking the sync/async commands needed by ironic to inspect,
clean and provision a node.

## Run Fake ipa with ironic
## Run FakeIPA

### Requirements

Machine: `4c / 16gb / 100gb`
OS: `CentOS9-20220330`

### Test fake ipa

1. clone the env scripts `cd` inside `fake-ipa/Run-env` folder
2. check configs in `config.py`
3. run init `./Init-environment.sh`
4. to just rebuild fake-ipa from the local repo run `./rebuild-fipa.sh`

### Use ironic with fake-ipa

At this step there will be an ironic environment using fake-ipa,
by default there will be two nodes created on ironic you can list them with:
`baremetal node list`

To manage the a node using the ironicclient:
`baremetal node manage <node-name>`

To inspect use: `baremetal node inspect <node-name>`
then you can provide and deploy image on the node with:

```bash
baremetal node provide <node-name>
baremetal node deploy <node-name>
```

### Clean

To clean the env `./clean.sh`
Dev-env provide an environment where we can test FakeIPA
Check WIP PR for more details:
<https://github.com/metal3-io/metal3-dev-env/pull/1450>
99 changes: 0 additions & 99 deletions fake-ipa/Run-env/01-vm-setup.sh

This file was deleted.

14 changes: 0 additions & 14 deletions fake-ipa/Run-env/02-configure-minikube.sh

This file was deleted.

72 changes: 0 additions & 72 deletions fake-ipa/Run-env/03-images-and-run-local-services.sh

This file was deleted.

16 changes: 0 additions & 16 deletions fake-ipa/Run-env/04-start-minikube.sh

This file was deleted.

78 changes: 0 additions & 78 deletions fake-ipa/Run-env/05-apply-manifests.sh

This file was deleted.

6 changes: 0 additions & 6 deletions fake-ipa/Run-env/Init-environment.sh

This file was deleted.

Loading

0 comments on commit fa61478

Please sign in to comment.