Skip to content

Commit e5f340c

Browse files
committed
Initial push to Github for Oracle Developer Day VM Builder
0 parents  commit e5f340c

File tree

76 files changed

+96122
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+96122
-0
lines changed

OTNLicense.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
WARNING: THIS VIRTUAL MACHINE IMAGE CONTAINS ORACLE PROPRIETARY SOFTWARE THAT IS LICENSED TO THE INDIVIDUAL THAT ORIGINALLY OBTAINED IT FROM ORACLE. IT MAY NOT BE TRANSFERRED OR DISTRIBUTED TO OTHER INDIVIDUALS, EVEN IF THOSE INDIVIDUALS ARE EMPLOYED BY THE SAME ENTITY. IF YOU DID NOT OBTAIN THIS IMAGE FROM AN ORACLE WEBSITE OR FROM AN AUTHORIZED ORACLE EMPLOYEE OR CONTRACTOR, YOU MAY NOT USE IT; VISIT WWW.ORACLE.COM/OTN TO DOWNLOAD A COPY YOU MAY USE.
2+
3+
IF YOU RECEIVED THIS VIRTUAL MACHINE IMAGE DIRECTLY FROM ORACLE THEN BY CONTINUING TO INSTALL THE VIRTUAL MACHINE IMAGE YOU AGREE TO THE LICENSE TERMS AT http://www.oracle.com/technetwork/licenses/vm-license-2130072.html

README.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
Oracle Developer Day VM Builder
2+
===============================
3+
4+
Welcome to the packer build for the Oracle Developer Day vm.
5+
This will build a Oracle Linux server and install a 12.2 Oracle database on the machine. Follow the download instructions to download the software to install and follow the build instructions to build the machine. You will need around 30gb of space free to store the downloads and run the build.
6+
7+
There are several directories which are used in the build
8+
9+
1. put_files_here - place ALL downloaded software here
10+
2. output - The resultant VirtualBox OVA will be placed here
11+
3. upload - This directory has all the install scripts for the downloaded software.
12+
13+
Mandatory Downloads
14+
-------------------
15+
**These two downloads are mandatory**. If they are not here, the build will not start.
16+
17+
* OracleLinux-R7-U3-Server-x86_64-dvd.iso (needs to be this exactly md5 checked)
18+
* linux\*122*_database.zip (12201 has been verified - silent install may be incompatible with later versions)
19+
20+
Optional Downloads
21+
--------------
22+
If these files are available in the **put_files_here** directory, the build will try and install them.
23+
24+
* jdk-8u\*-linux-x64.tar.gz - **Oracle JDK**
25+
* sqldeveloper-\*-no-jre.zip - **Oracle SQL Developer**
26+
* datamodeler-\*-no-jre.zip **Oracle SQLDeveloper Data Modeler**
27+
* sqlcl-\*-no-jre.zip - **Oracle SQLcl**
28+
* apex_5\*.zip - **Oracle Application Express**
29+
* ords\*.zip - **Oracle REST Data Services**
30+
31+
Oracle Internal Files
32+
---------------------
33+
These files may not be available publicly
34+
35+
* demos.zip - **Oracle Hands on Labs demos**
36+
* reset_xmldbjson ** Reset XMLdb demos**
37+
* master.zip - **Oracle Sample Schema**
38+
* mozillablob.zip - **firefox .mozilla for (json viewer) plugins and or bookmarks**
39+
* storm.zip - **exp dump of non sensative material. For geo location optional demo.**
40+
41+
Build Instructions
42+
------------------
43+
44+
>**bash start.sh "http://and_proxy_as_first_arg_if_wanted" export**
45+
46+
NOTE Proxy value will be in the logs from bash set -x stored in ~oracle/log
47+
If you are inside a VPN, the proxy settings allow the VM to contact yum
48+
update servers. optional export to export the ova.
49+
50+
![packer build](images/packerbuild.png)
51+
52+
Build Structure
53+
--------------------
54+
55+
1. 1updateLinux.sh PROGRESS: 1/4 1updateLinux.sh - first script run - from plain iso. Set up second drive. Yum Updates. Reboot
56+
2. 2afterFirstReboot.sh PROGRESS: 2/4 2afterFirstReboot.sh - after first reboot - before any oracle database software installed. install virtual box guest additions.
57+
3. 3topLevel.sh PROGRESS: 3/4 3topLevel.sh - main kick off script e.g. yum and call subscripts
58+
4. 3_1installDbtoolClientTools.sh PROGRESS: 3_1/4 3_1installDbtoolClientTools.sh - install dbtools client tools
59+
5. 3_2installDatabase.sh PROGRESS: 3_2/4 3_2installDatabase.sh - install the database with silent install
60+
6. 3_3passwordDoNotExpire.sh PROGRESS: 3_3/4 3_3passwordDoNotExpire.sh - Database post install updates - e.g. passwords do not expire.
61+
7. 3_4enableGeoRaster.sh PROGRESS: 3_4/4 3_4enableGeoRaster.sh - post database install and patches (if required)
62+
8. 3_5unzipLabDemos.sh PROGRESS: 3_5/4 3_5unzipLabDemos.sh - demos (labs)
63+
9. 3_6apexInstall.sh PROGRESS: 3_6/4 3_6apexInstall.sh - apex install
64+
10. 3_7ORDSInstall.sh PROGRESS: 3_7/4 3_7ORDSInstall.sh - ords install
65+
11. 3_8setupDemos.sh PROGRESS: 3_8/4 3_8setupDemos.sh - set up demos and run reset scripts
66+
12. PROGRESS: END OF SCRIPT: 4/4 for tracing information see local file log.zip
67+
68+
Timings:
69+
70+
Minimum (Oracle Linux + Oracle Database)
71+
Total time 60 mins (accounted for time + 7 mins rounding error / ignore <2 minute).
72+
73+
boot,8
74+
yum update,14
75+
reboot ,3
76+
run database software install (not database build),3
77+
dbca (database build),7
78+
password and 32kvarchar2,6
79+
shrink (fill disk with 0 for easy compression),3
80+
1 x 3 minute reboot + shutdown + minor <1 minute stuff,10
81+
82+
Maximum (Including all optional extras APEX/ORDS/((internal) demos)
83+
Total time 113.5 mins (Accounted for time + 10.5 mins rounding error / ignore <2 minute).
84+
boot,9
85+
yum update,14
86+
reboot,3
87+
run database software install (not database build),4
88+
dbca (database build),8
89+
password and 32kvarchar <should be same as minimum?>,18
90+
apex install ,16
91+
ords install ,4
92+
set up demos and run demo reset,18
93+
shrink (fill disk with 0 for easy compression),2
94+
1 x 3 minute reboot + shutdown + minor <1 minute stuff - this is too long,9
95+
96+
Removing the shrink.sh if not exporting - fills disk with 0 for easy compression.
97+
Run shrink.sh over ssh if subsequently exporting to ova (brings ova file down 60% in size to under 8Gb)

apacheLicense.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

images/packerbuild.png

140 KB
Loading

license.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

packerConfig.json

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
{
2+
"variables": {
3+
"iso_downloaded": null,
4+
"oracle_database_downloaded": null,
5+
"proxy": "",
6+
"skip_export": "true"
7+
},
8+
"provisioners": [
9+
{
10+
"type": "file",
11+
"source": "upload",
12+
"destination": "/tmp"
13+
},
14+
{
15+
"type": "file",
16+
"source": "put_files_here",
17+
"destination": "/tmp"
18+
},
19+
{
20+
"type": "shell",
21+
"inline": ["echo 'oracle' | sudo -S -E bash -c 'mv /tmp/upload /tmp/1 && chmod -R 777 /tmp/1 && chown -R oracle /tmp/1 && /tmp/1/1updateLinux.sh {{user `proxy`}} && /sbin/shutdown -r +1'"]
22+
},
23+
{
24+
"pause_before": "200s",
25+
"type": "shell",
26+
"inline": ["echo not necessaryQQQ /home/oracle/bin/nuketimestamps>/dev/null && echo 'oracle'|sudo -S -E bash -c '/tmp/1/2afterFirstReboot.sh 2>&1 | tee /root/log$$ && /tmp/1/3topLevel.sh && /sbin/shutdown -r +1'"
27+
]
28+
},
29+
{
30+
"pause_before": "200s",
31+
"type": "file",
32+
"source": "log.zip",
33+
"destination": "log.zip",
34+
"direction": "download"
35+
},
36+
{
37+
"type": "shell",
38+
"inline": ["rm log.zip"
39+
]
40+
}
41+
],
42+
"builders": [
43+
{
44+
"type": "virtualbox-iso",
45+
"ssh_skip_nat_mapping": true,
46+
"ssh_host": "127.0.0.1",
47+
"ssh_port": 2222,
48+
"disk_size": "30000",
49+
"guest_os_type": "Oracle_64",
50+
"hard_drive_interface": "sata",
51+
"boot_command": [
52+
"<wait10>",
53+
"<tab><wait5> text<wait> noverifyssl <wait>",
54+
"ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/buildTimeConfig.cfg<enter><wait>"
55+
],
56+
"vboxmanage": [
57+
[ "modifyvm", "{{.Name}}", "--memory", "4096" ],
58+
[ "modifyvm", "{{.Name}}", "--cpus", "2" ],
59+
[ "createhd", "--filename", "Oracle DB Developer VMo_2.vdi", "--size", "30000"],
60+
[ "storageattach", "{{.Name}}", "--storagectl", "SATA Controller", "--port", "1", "--device", "0" ,"--type", "hdd", "--medium", "Oracle DB Developer VMo_2.vdi"],
61+
[ "modifyvm", "{{.Name}}", "--clipboard", "bidirectional"],
62+
[ "modifyvm", "{{.Name}}", "--draganddrop", "bidirectional"],
63+
[ "modifyvm", "{{.Name}}", "--paravirtprovider", "kvm"],
64+
[ "modifyvm", "{{.Name}}", "--natpf1", "net8,tcp,,1521,,1521"],
65+
[ "modifyvm", "{{.Name}}", "--natpf1", "ssh,tcp,,2222,,22"],
66+
[ "modifyvm", "{{.Name}}", "--natpf1", "apex8080,tcp,,8080,,8080"],
67+
[ "modifyvm", "{{.Name}}", "--natpf1", "apex8081,tcp,,8081,,8081"],
68+
[ "modifyvm", "{{.Name}}", "--audio", "none"],
69+
[ "modifyvm", "{{.Name}}", "--vram", "128"]
70+
],
71+
"vboxmanage_post": [
72+
[ "modifyvm", "{{.Name}}", "--memory", "2048" ],
73+
[ "modifyvm", "{{.Name}}", "--cpus", "1" ],
74+
[ "storageattach", "{{.Name}}", "--storagectl", "IDE Controller", "--port", "1", "--device", "0", "--type", "dvddrive", "--medium", "emptydrive"]
75+
],
76+
"guest_additions_mode": "upload",
77+
"iso_url": "OracleLinux-R7-U3-Server-x86_64-dvd.iso",
78+
"iso_checksum_type": "md5",
79+
"iso_checksum": "e44eff40f3a16ffa008285e5c52e1199",
80+
"format": "ova",
81+
"boot_wait": "10s",
82+
"ssh_username": "oracle",
83+
"ssh_password": "oracle",
84+
"ssh_wait_timeout": "2400s",
85+
"output_directory": "output",
86+
"shutdown_command": "echo 'oracle' | sudo -S shutdown -P now",
87+
"post_shutdown_delay": "30s",
88+
"keep_registered": "{{user `skip_export`}}",
89+
"skip_export": "{{user `skip_export`}}",
90+
"shutdown_timeout": "10m",
91+
"vm_name": "Oracle DB Developer VM",
92+
"http_directory":"upload",
93+
"export_opts": ["--vsys", "0","--eulafile","license.txt", "--product", "Oracle RDBMS 12.2, Application Express 5.1,REST Data Services 3.0,SQL Developer 4.2", "--producturl", "http://otn.oracle.com", "--vendor", "Oracle", "--vendorurl", "http://www.oracle.com", "--version", "May_2017"]
94+
}
95+
]
96+
}

put_files_here/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Put files required in build here**
2+
3+
Required Files
4+
--------------
5+
* OracleLinux-R7-U3-Server-x86_64-dvd.iso (needs to be this exactly md5 checked)
6+
* linux\*122*_database.zip (12201 has been verified - silent install may be incompatible with later versions)
7+
8+
Optional Downloads
9+
--------------
10+
If these files are available in the **put_files_here** directory, the build will try and install them.
11+
12+
* demos.zip - **Oracle Hands on Labs demos**
13+
* jdk-8u\*-linux-x64.tar.gz - **Oracle JDK**
14+
* sqldeveloper-\*-no-jre.zip - **Oracle SQL Developer**
15+
* sqlcl-\*-no-jre.zip - **Oracle SQLcl**
16+
* apex_5\*.zip - **Oracle Application Express**
17+
* ords\*.zip - **Oracle REST Data Services**
18+
* datamodeler-\*-no-jre.zip **Oracle SQLDeveloper Data Modeler**
19+
* mozillablob.zip - **firefox .mozilla for (json viewer) plugins and or bookmarks**
20+
* storm.zip - **exp dump of non sensative material. For geo location optional demo.**
21+
* reset_xmldbjson
22+
* master.zip - **Oracle Sample Schema**
23+

start.sh

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#!/bin/bash
2+
3+
#
4+
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
19+
20+
21+
#################################################################################
22+
#
23+
# File: start.sh
24+
#
25+
# Description: Start script to check initial files required for starting the
26+
# packer build. At a minimum, the Linux iso and the database zip
27+
# are required before the packer build will start. Everything else
28+
# is optional.
29+
# if needed pass proxy in,
30+
# if needed use the string 'export' to produce an .ova file
31+
# (proxy or export in any order)
32+
#################################################################################
33+
34+
#
35+
# Cleanup old builds and remove previous output if it exists.
36+
#
37+
function cleanup {
38+
rm -rf *.vdi
39+
rm -rf output_last
40+
mv output output_last
41+
}
42+
43+
#
44+
# Check that at aminimum, the Linux iso, and the main database install zip
45+
# are present otherwise, there is no point in continuing
46+
#
47+
function check_required_files {
48+
export varsaccepted=
49+
if test -f put_files_here/OracleLinux-R7-U3-Server-x86_64-dvd.iso
50+
then
51+
export varsaccepted=" -var iso_downloaded=y "
52+
cp -n put_files_here/OracleLinux-R7-U3-Server-x86_64-dvd.iso .
53+
fi
54+
if test -f put_files_here/linuxx64*122*database.zip
55+
then
56+
export varsaccepted=" $varsaccepted -var oracle_database_downloaded=y "
57+
fi
58+
if test "m$2" = "mexport"
59+
then
60+
export varsaccepted=" $varsaccepted -var proxy=$1 -var skip_export=false "
61+
elif test "m$1" = "mexport"
62+
then
63+
export varsaccepted=" $varsaccepted -var proxy=$2 -var skip_export=false "
64+
else
65+
export varsaccepted=" $varsaccepted -var proxy=$1 "
66+
fi
67+
}
68+
#
69+
# start the packer build with a proxy if it is set.
70+
#
71+
function start_packer_build {
72+
packer build $varsaccepted packerConfig.json
73+
}
74+
75+
#Lets go.
76+
cleanup
77+
check_required_files $1 $2
78+
start_packer_build

upload/1updateLinux.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/bash
2+
3+
#
4+
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
19+
#################################################################################
20+
#
21+
# File: 1updateLinux.sh
22+
#
23+
# Description: Start script to check initial files required for starting the
24+
# packer build. At a minimum, the Linux iso and the database zip
25+
# are required before the packer build will start. Everything else
26+
# is optional.
27+
# if needed pass proxy in as $1
28+
#################################################################################
29+
30+
function bootstrap_logging {
31+
#
32+
# Copying files to home which decorate logs, ie starting and ending phases.
33+
# buildTimeReportSkippingFile.sh is used when some install zips are not available and buildTimeEndOfAllScripts.sh
34+
# is the final end which will cleanup
35+
#
36+
cp /tmp/1/runTimeStartScript.sh /tmp/1/buildTimeEnd.sh /tmp/1/runTimeStagesText.txt /tmp/1/buildTimeEndOfAllScripts.sh /tmp/1/buildTimeReportSkippingFile.sh ~oracle
37+
touch ~oracle/debug_output.txt
38+
chmod 777 ~oracle/runTimeStartScript.sh ~oracle/buildTimeEnd.sh ~oracle/runTimeStagesText.txt ~oracle/debug_output.txt ~oracle/buildTimeReportSkippingFile.sh ~oracle/buildTimeEndOfAllScripts.sh
39+
chown oracle ~oracle/runTimeStartScript.sh ~oracle/buildTimeEnd.sh ~oracle/runTimeStagesText.txt ~oracle/debug_output.txt ~oracle/buildTimeReportSkippingFile.sh ~oracle/buildTimeEndOfAllScripts.sh
40+
41+
mkdir ~oracle/log
42+
chmod 777 ~oracle/log
43+
chown oracle ~oracle/log
44+
}
45+
46+
#
47+
# Update linux with YUM
48+
#
49+
function update_linux {
50+
(/tmp/1/1updateLinux_inner.sh "$@" 2>&1) | tee -a ~oracle/log/thestdoutlog_`basename $0`_$$ | egrep '^PROGRESS'
51+
}
52+
53+
bootstrap_logging
54+
update_linux "$@"

0 commit comments

Comments
 (0)