-
Notifications
You must be signed in to change notification settings - Fork 16
Added run_container.sh script, formatted README #250
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
34b7cfd
e67ee06
2293cf1
7157aae
8db5407
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,3 +10,4 @@ cypress/videos/* | |
| dist/ | ||
| node_modules/ | ||
| npm-debug.log* | ||
| tests/settings | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,64 +4,37 @@ A community driven UI for [Pulp](https://pulpproject.org/). | |
|
|
||
| ## How to run | ||
|
|
||
| ### backend | ||
| ### Backend | ||
|
|
||
| You can follow the [pulp-oci-images quickstart](https://pulpproject.org/pulp-oci-images/docs/admin/tutorials/quickstart/), | ||
| TLDR: | ||
| The `tests/run_container.sh` script is provided and allows you to run a command with a [Pulp in one](https://pulpproject.org/pulp-in-one-container/) container active. | ||
|
||
| It requires Docker or Podman to be installed. | ||
| The default credentials are: | ||
| Username: admin | ||
| Password: password | ||
|
|
||
| #### setup: | ||
|
|
||
| ```sh | ||
| mkdir -p ~/pulp-backend-oci/{settings/certs,pulp_storage,pgsql,containers} | ||
| cd ~/pulp-backend-oci/ | ||
| echo " | ||
| CONTENT_ORIGIN='http://$(hostname):8080' | ||
| ANSIBLE_API_HOSTNAME='http://$(hostname):8080' | ||
| ANSIBLE_CONTENT_HOSTNAME='http://$(hostname):8080/pulp/content' | ||
| " >> settings/settings.py | ||
| ``` | ||
|
|
||
| #### run: | ||
|
|
||
| ```sh | ||
| cd ~/pulp-backend-oci/ | ||
| podman run --publish 8080:80 \ | ||
| --replace --name pulp \ | ||
| --volume "$(pwd)/settings":/etc/pulp \ | ||
| --volume "$(pwd)/pulp_storage":/var/lib/pulp \ | ||
| --volume "$(pwd)/pgsql":/var/lib/pgsql \ | ||
| --volume "$(pwd)/containers":/var/lib/containers \ | ||
| docker.io/pulp/pulp | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. keep the minimal setup documented please It's more useful as 20 lines of docs, than 100 lines of script.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have re-added original setup documentation |
||
| ./tests/run_container sleep inf | ||
| ``` | ||
|
|
||
| #### check: | ||
| #### Check: | ||
|
|
||
| ```sh | ||
| curl localhost:8080/pulp/api/v3/status/ | jq | ||
| ``` | ||
|
|
||
| or open http://localhost:8080/pulp/api/v3/status/ | ||
|
|
||
| #### change password: | ||
|
|
||
| ```sh | ||
| podman exec -it pulp pulpcore-manager reset-admin-password --password admin | ||
| ``` | ||
| ```sh | ||
| docker exec -it compose-pulp_api-1 pulpcore-manager reset-admin-password --password admin | ||
| ``` | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep this please. This is where I look when I need to change the backend password, it's not so useful when hidden inside a script.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added back to readme |
||
| #### configure `pulp-cli`: | ||
| #### Configure `pulp-cli`: | ||
|
|
||
| ```sh | ||
| pip install pulp-cli[pygments] | ||
| pulp config create --username admin --base-url http://localhost:8080 --password admin | ||
| pulp config create --username admin --base-url http://localhost:8080 --password password | ||
|
|
||
| pulp --help | ||
| pulp user list | ||
| ``` | ||
|
|
||
| ### frontend | ||
| ### Frontend | ||
|
|
||
| You can clone the frontend from https://github.com/pulp/pulp-ui . | ||
|
|
||
|
|
@@ -72,12 +45,12 @@ npm run start | |
|
|
||
| and open http://localhost:8002/ :tada: :) | ||
|
|
||
| If your API listens elsewhere, you can use `API_PROXY=http://elsewhere:12345 npm run start` instead. Do note that the server at `elsewhere` has to be configured to allow CORS requests for `localhost` (where UI actually listens); using something like `changeOrigin` is out of scope for pulp-ui, and breaks pulp API URLs (because the domains are based on the Origin header). Do NOT use webpack proxy in production. | ||
| If your PULP API listens elsewhere, you can use `API_PROXY=http://elsewhere:12345 npm run start` instead. Do note that the server at `elsewhere` has to be configured to allow CORS requests for `localhost` (where UI actually listens); using something like `changeOrigin` is out of scope for pulp-ui, and breaks pulp API URLs (because the domains are based on the Origin header). Do NOT use webpack proxy in production. | ||
|
|
||
|
|
||
| ## Misc | ||
|
|
||
| ### post-build configuration | ||
| ### Post-build configuration | ||
|
|
||
| The UI builds produced by `npm run build` can be further configured by serving a `/pulp-ui-config.json` alongside the built UI. | ||
| (Note it has to be mapped at `/`, not just wherever `index.html` is served from.) | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,97 @@ | ||||||||
| #!/bin/sh | ||||||||
|
||||||||
| #!/bin/sh | |
| #!/bin/bash |
given the rest of the script, this has to be bash not sh - at least $() won't work in plain sh, and I'm not sure about all those ${:+} either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect the original author wrote this with sh as a symlink to bash. Have updated it point directly to bash.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--tag ghcr.io/pulp/pulp:"${IMAGE_TAG}"
This looks wrong, nothing in this repo should be building a pulp/pulp image.
And it very clearly doesn't come from ghcr.io, so maybe not that either? Just name it pulp-ui or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed from run_container.sh script.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BASEPATH points to pulp-ui/tests/, which is empty except for run_container.sh
Which /assets/ are we talking about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed from run_container.sh script.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bash: getenforce: command not found
you will need to check for its existence first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a check to determine if getenforce is present
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(and here, there is no pulp-ui/tests/settings)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was my mistake, I've added settings.py and changed .gitignore to exclude the tests/settings/certs/ directory.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(and here, ghcr.io/pulp/pulp is not the right name)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed this to docker.io
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(and here, there is no pulp-ui/tests/container_setup.d/)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed from run_container.sh script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| PULP_LOGGING="${CONTAINER_RUNTIME}" "$@" | |
| echo Press ^C to stop the container 1>&2 | |
| sleep inf |
and we don't need to document any params for it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did think of this. But one way this script can be use is running it with test software, Squeezer (ansible module) does it like this:
./tests/run_container.sh make livetest
This allows a user to start a pulp oci container, run tests against it and automatically have it remove itself when complete.
This script could be used in the same way for this repository in the future.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
squeezer does actually have
tests/settings, which are NOT gitignored .. sounds like a meaningful difference given https://github.com/pulp/pulp-ui/pull/250/files#r2231553649There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was my mistake, I've added tests/testtings/settings.py and changed .gitignore to exclude the tests/settings/certs/ directory.