summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSeth Foster <fosterseth@users.noreply.github.com>2024-07-29 21:13:09 +0200
committerGitHub <noreply@github.com>2024-07-29 21:13:09 +0200
commita41766090e30d117e39d4646f67f20a8c2c00841 (patch)
treeee400654123df503314ce659fbb8999e8b334595 /tools
parentBump django-ansible-base to 2024.7.17 (#15373) (diff)
downloadawx-a41766090e30d117e39d4646f67f20a8c2c00841.tar.xz
awx-a41766090e30d117e39d4646f67f20a8c2c00841.zip
Make ui_next the default UI (#15405)
Change django url dispatcher to serve up ui_next files instead of old ui files Old UI will not be served with this change Github CI still runs old ui tests (to be removed in another PR) Remove the Github workflows that build old UI --------- Signed-off-by: Seth Foster <fosterbseth@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/ansible/roles/dockerfile/templates/Dockerfile.j228
-rw-r--r--tools/docker-compose/README.md28
-rwxr-xr-xtools/docker-compose/bootstrap_development.sh2
3 files changed, 38 insertions, 20 deletions
diff --git a/tools/ansible/roles/dockerfile/templates/Dockerfile.j2 b/tools/ansible/roles/dockerfile/templates/Dockerfile.j2
index 2ea6522510..b8a626be0e 100644
--- a/tools/ansible/roles/dockerfile/templates/Dockerfile.j2
+++ b/tools/ansible/roles/dockerfile/templates/Dockerfile.j2
@@ -4,6 +4,18 @@
### DO NOT EDIT
###
+{% if not headless|bool %}
+# UI_next build contaienr
+FROM quay.io/centos/centos:stream9 AS ui-next-builder
+USER root
+RUN dnf -y update && dnf install -y nodejs make git
+RUN npm install -g n && n 18
+
+COPY . /tmp/src/
+WORKDIR /tmp/src/
+RUN make ui-next
+{% endif %}
+
# Build container
FROM quay.io/centos/centos:stream9 AS builder
@@ -31,9 +43,6 @@ RUN dnf -y update && dnf install -y 'dnf-command(config-manager)' && \
libffi-devel \
libtool-ltdl-devel \
make \
-{% if not headless|bool %}
- nodejs \
-{% endif %}
nss \
openldap-devel \
# pin to older openssl, see jira AAP-23449
@@ -74,21 +83,20 @@ RUN cd /tmp && make requirements_awx
ARG VERSION
ARG SETUPTOOLS_SCM_PRETEND_VERSION
-ARG HEADLESS
{% if (build_dev|bool) or (kube_dev|bool) %}
ADD requirements/requirements_dev.txt /tmp/requirements
RUN cd /tmp && make requirements_awx_dev
{% else %}
-# Use the distro provided npm to bootstrap our required version of node
-
-{% if not headless|bool %}
-RUN npm install -g n && n 16.13.1
-{% endif %}
# Copy source into builder, build sdist, install it into awx venv
COPY . /tmp/src/
WORKDIR /tmp/src/
+
+{% if not headless|bool %}
+COPY --from=ui-next-builder /tmp/src/awx/ui_next/build /tmp/src/awx/ui_next/build
+{% endif %}
+
RUN make sdist && /var/lib/awx/venv/awx/bin/pip install dist/awx.tar.gz
{% if not headless|bool %}
@@ -189,7 +197,7 @@ COPY --from=builder /var/lib/awx /var/lib/awx
RUN ln -s /var/lib/awx/venv/awx/bin/awx-manage /usr/bin/awx-manage
-{%if build_dev|bool %}
+{% if build_dev|bool %}
COPY --from={{ receptor_image }} /usr/bin/receptor /usr/bin/receptor
RUN openssl req -nodes -newkey rsa:2048 -keyout /etc/nginx/nginx.key -out /etc/nginx/nginx.csr \
diff --git a/tools/docker-compose/README.md b/tools/docker-compose/README.md
index 22a3c7b390..1d3e5f410e 100644
--- a/tools/docker-compose/README.md
+++ b/tools/docker-compose/README.md
@@ -208,13 +208,25 @@ awx_1 | Applying auth.0001_initial... OK
##### Clean and build the UI
+Prerequisites (on your local machine)
+- npm
+- nodejs
+
+Required versions listed here https://github.com/ansible/ansible-ui/blob/main/README.md
+
+On your local machine (not in awx container)
+
```bash
-$ docker exec tools_awx_1 make clean-ui ui-devel
+make clean/ui-next ui-next
```
-See [the ui development documentation](../../awx/ui/README.md) for more information on using the frontend development, build, and test tooling.
+This will clone the ansible-ui into the `awx/ui_next/src` directory and build the static files. Then when the containers come up, awx-manage collectstatic will copy those files into the proper place.
+
+You can also use `UI_NEXT_LOCAL` to build from a locally cloned ansible-ui repo.
+
+See [the ui development documentation](https://github.com/ansible/ansible-ui/blob/main/CONTRIBUTING.md) for more information on using the frontend development, build, and test tooling.
-Once migrations are completed and the UI is built, you can begin using AWX. The UI can be reached in your browser at `https://localhost:8043/#/home`, and the API can be found at `https://localhost:8043/api/v2`.
+Once migrations are completed and the UI is built, you can begin using AWX. The UI can be reached in your browser at `https://localhost:8043/`, and the API can be found at `https://localhost:8043/api/v2`.
##### Create an admin user
@@ -561,11 +573,11 @@ If you have a playbook like:
var: the_secret_from_vault
```
-And run it through AWX with the credential `Credential From Vault via Token Auth` tied to it, the debug should result in `this_is_the_secret_value`. If you run it through AWX with the credential `Credential From Vault via Userpass Auth`, the debug should result in `this_is_the_userpass_secret_value`.
+And run it through AWX with the credential `Credential From Vault via Token Auth` tied to it, the debug should result in `this_is_the_secret_value`. If you run it through AWX with the credential `Credential From Vault via Userpass Auth`, the debug should result in `this_is_the_userpass_secret_value`.
### HashiVault with LDAP
-If you wish to have your OpenLDAP container connected to the Vault container, you will first need to have the OpenLDAP container running alongside AWX and Vault.
+If you wish to have your OpenLDAP container connected to the Vault container, you will first need to have the OpenLDAP container running alongside AWX and Vault.
```bash
@@ -574,7 +586,7 @@ VAULT=true LDAP=true make docker-compose
```
-Similar to the above, you will need to unseal the vault before we can run the other needed playbooks.
+Similar to the above, you will need to unseal the vault before we can run the other needed playbooks.
```bash
@@ -582,7 +594,7 @@ ansible-playbook tools/docker-compose/ansible/unseal_vault.yml
```
-Now that the vault is unsealed, we can plumb the vault container now while passing true to enable_ldap extra var.
+Now that the vault is unsealed, we can plumb the vault container now while passing true to enable_ldap extra var.
```bash
@@ -595,7 +607,7 @@ ansible-playbook tools/docker-compose/ansible/plumb_vault.yml -e enable_ldap=tru
```
-This will populate your AWX instance with LDAP specific items.
+This will populate your AWX instance with LDAP specific items.
- A vault LDAP Lookup Cred tied to the LDAP `awx_ldap_vault` user called `Vault LDAP Lookup Cred`
- A credential called `Credential From HashiCorp Vault via LDAP Auth` which is of the created type using the `Vault LDAP Lookup Cred` to get the secret.
diff --git a/tools/docker-compose/bootstrap_development.sh b/tools/docker-compose/bootstrap_development.sh
index dba10866d3..eff6b3a590 100755
--- a/tools/docker-compose/bootstrap_development.sh
+++ b/tools/docker-compose/bootstrap_development.sh
@@ -23,8 +23,6 @@ else
wait-for-migrations
fi
-# Make sure that the UI static file directory exists, Django complains otherwise.
-mkdir -p /awx_devel/awx/ui/build/static
# Make sure that the UI_NEXT statifc file directory exists, if UI_NEXT is not built yet put a placeholder file in it.
if [ ! -d "/awx_devel/awx/ui_next/build/awx" ]; then