Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright © 2026, Oracle and/or its affiliates.
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.

.terraform
*tfstate*
*.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!--

# Copyright © 2026, Oracle and/or its affiliates.
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.


-->
# Contributing to Oracle Cloud Foundation Terraform Framework

## Contributing to Oracle Cloud Foundation Terraform Framework

Oracle welcomes contributions to this repository from anyone.

If you want to submit a pull request to fix a bug or enhance an existing
feature, please first open an issue and link to that issue when you
submit your pull request.

If you have any questions about a possible submission, feel free to open
an issue too.

## Pull request process

1. Fork this repository
1. Create a branch in your fork to implement the changes. We recommend using
the issue number as part of your branch name, e.g. `1234-fixes`
1. Ensure that there is at least one test that would fail without the fix and
passes post fix
1. Submit the pull request. *Do not leave the pull request blank*. Explain exactly
what your changes are meant to do and provide simple steps on how to validate
your changes, ideally referencing the test. Ensure that you reference the issue
you created as well. We will assign the pull request to 1-2 people for review
before it is submitted internally and the PR is closed.
27 changes: 27 additions & 0 deletions cloud-foundation/solutions/AI-Live-Hub-Fashion-Retail-Demo/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright © 2026 Oracle and/or its affiliates. All rights reserved.

The Universal Permissive License (UPL), Version 1.0

Subject to the condition set forth below, permission is hereby granted to any person obtaining a copy of this
software, associated documentation and/or data (collectively the "Software"), free of charge and under any and
all copyright rights in the Software, and any and all patent rights owned or freely licensable by each licensor
hereunder covering either (i) the unmodified Software as contributed to or provided by such licensor, or
(ii) the Larger Works (as defined below), to deal in both

(a) the Software, and
(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if one is included with the Software
(each a “Larger Work” to which the Software is contributed by such licensors),

without restriction, including without limitation the rights to copy, create derivative works of, display,
perform, and distribute the Software and make, use, sell, offer for sale, import, export, have made, and have
sold the Software and the Larger Work(s), and to sublicense the foregoing rights on either these or other terms.

This license is subject to the following condition:
The above copyright notice and either this complete permission notice or at a minimum a reference to the UPL must
be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
1,647 changes: 1,647 additions & 0 deletions cloud-foundation/solutions/AI-Live-Hub-Fashion-Retail-Demo/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
#!/usr/bin/env bash
set -euo pipefail

VARIABLES_FILE="${VARIABLES_FILE:-variables.tf}"

get_tf_default() {
local var_name="$1"
local file="$2"

python3 - "$var_name" "$file" <<'PY'
import re
import sys

var_name = sys.argv[1]
file_path = sys.argv[2]

try:
with open(file_path, "r", encoding="utf-8") as f:
content = f.read()
except FileNotFoundError:
print("")
sys.exit(0)

pattern = re.compile(
r'variable\s+"{}"\s*\{{.*?default\s*=\s*"([^"]+)".*?\}}'.format(re.escape(var_name)),
re.DOTALL
)

match = pattern.search(content)
print(match.group(1) if match else "")
PY
}

BUCKET_1="${1:-$(get_tf_default files_bucket_name "$VARIABLES_FILE")}"
BUCKET_2="${2:-$(get_tf_default atp_creds_bucket_name "$VARIABLES_FILE")}"

if [ -z "${BUCKET_1:-}" ]; then
BUCKET_1="AgenticAiFiles"
fi

if [ -z "${BUCKET_2:-}" ]; then
BUCKET_2="AgenticATPCreds"
fi

NAMESPACE="$(oci os ns get --query 'data' --raw-output)"
BUCKETS=("${BUCKET_1}" "${BUCKET_2}")

echo "Using buckets:"
echo " files bucket = ${BUCKET_1}"
echo " atp creds bucket = ${BUCKET_2}"
echo " namespace = ${NAMESPACE}"

for BUCKET in "${BUCKETS[@]}"; do
echo "=================================================="
echo "Cleaning bucket: ${BUCKET}"
echo "Namespace: ${NAMESPACE}"
echo "=================================================="

while true; do
TMP_JSON="$(mktemp)"
oci os object list-object-versions \
--namespace-name "${NAMESPACE}" \
--bucket-name "${BUCKET}" \
--all \
--output json > "${TMP_JSON}" 2>/dev/null || true

COUNT="$(python3 - "${TMP_JSON}" <<'PY'
import json, sys
path = sys.argv[1]
try:
with open(path, "r", encoding="utf-8") as f:
data = json.load(f).get("data", [])
print(len(data))
except Exception:
print(0)
PY
)"
if [ "${COUNT}" = "0" ]; then
rm -f "${TMP_JSON}"
break
fi

python3 - "${TMP_JSON}" "${NAMESPACE}" "${BUCKET}" <<'PY'
import json
import subprocess
import sys

path = sys.argv[1]
namespace = sys.argv[2]
bucket = sys.argv[3]

with open(path, "r", encoding="utf-8") as f:
data = json.load(f).get("data", [])

for item in data:
name = item.get("name")
version_id = item.get("version-id")
if name and version_id:
subprocess.run([
"oci", "os", "object", "delete",
"--namespace-name", namespace,
"--bucket-name", bucket,
"--name", name,
"--version-id", version_id,
"--force"
], check=False)
PY

rm -f "${TMP_JSON}"
sleep 2
done

while true; do
TMP_JSON="$(mktemp)"
oci os object list \
--namespace-name "${NAMESPACE}" \
--bucket-name "${BUCKET}" \
--all \
--output json > "${TMP_JSON}" 2>/dev/null || true

COUNT="$(python3 - "${TMP_JSON}" <<'PY'
import json, sys
path = sys.argv[1]
try:
with open(path, "r", encoding="utf-8") as f:
data = json.load(f).get("data", [])
print(len(data))
except Exception:
print(0)
PY
)"
if [ "${COUNT}" = "0" ]; then
rm -f "${TMP_JSON}"
break
fi

python3 - "${TMP_JSON}" "${NAMESPACE}" "${BUCKET}" <<'PY'
import json
import subprocess
import sys

path = sys.argv[1]
namespace = sys.argv[2]
bucket = sys.argv[3]

with open(path, "r", encoding="utf-8") as f:
data = json.load(f).get("data", [])

for item in data:
name = item.get("name")
if name:
subprocess.run([
"oci", "os", "object", "delete",
"--namespace-name", namespace,
"--bucket-name", bucket,
"--name", name,
"--force"
], check=False)
PY

rm -f "${TMP_JSON}"
sleep 2
done

echo "Bucket cleaned: ${BUCKET}"
done

echo "All requested buckets were cleaned."
Loading