►
Description
In this video, Veer Muchandi demos the Source to Image (S2I or STI) process which converts application source code into a deployable docker image. Using the OpenShift web console, Veer creates a new project with two pods - one with a MySQL database and the other with a PHP front end that displays the contents of that database.
NOTE: This demo is based on a beta version of OpenShift 3 - features and content are subject to change prior to release. For the latest information on OpenShift 3, please visit http://openshift.com or subscribe to the OpenShift Blog (https://blog.openshift.com).
A
Hello
in
the
last
two
videos
you
have
seen
how
we
can
take
an
existing
docker
image
and
deploying
to
openshift.
We
looked
at
an
example
of
an
application
where
you
took
a
my
sequel
database,
docker
image
and
deployed
it
into
OpenShift,
and
then
we
took
a
a
PHP
application,
which
was
also
built
as
a
docker
image
and
then
deployed
into
open
shot
now
in
this
video,
what
we'll
be
seeing?
A
What
we
call
s2i
process,
which
is
s2i,
stands
for
source
to
image
conversion,
and
this
is
the
process
where
openshift
will
take
your
application
source
code
and
build
a
docker
image
for
it.
It
you'll
see
how
simple
it
is
to
do
so
I'm
going
to
do
this
using
a
web
console.
So
let
me
log
on
to
the
web
console
first.
This
is
a
OpenShift
beta
for
installation,
I'm
logging
on
to
the
web
console.
A
A
Now
that
the
project
is
created,
you
can
see
that
the
project
is
empty.
There
is
nothing
inside
it.
So
now,
let's
add
our
first
component
to
it
just
like
before
we
are
going
to
create
a
my
sequel
database
in
this
project
and
this
time,
instead
of
doing
it
in
the
way
in
which
we
did
before,
where
we
were
pulling
an
existing
docker
image
by
using
a
command
line
by
deploying
an
app
by
deploying
a
pod
that
runs
my
sequel
database.
A
This
time,
what
we
are
going
to
do
is
create
it
from
what
we
call
a
template,
a
template.
It
describes
a
set
of
resources
that
are
intended
with
India
need
to
be
used
together.
So
when
we
are
trying
to
quickly
spin
up
in
new
application,
it's
it's
easier
to
use
templates.
So
I'm
going
to
select
the
my
sequel
template
from
here.
We
are.
This
template
provides
some
parameters
that
you
can
pass
so
I'm
going
to
edit
these
parameters.
A
A
Add
the
labels
and
then
I
will
say
create
now
this.
This
will
be
created
as
part
of
the
my
PHP
application
project.
So
what
it
will
do
is
it
will
spin
up
the
my
sequel
database
that
runs
as
part
of
this
palette.
So,
as
you
can
see
on
the
console,
it's
actually
spinning
up
a
new,
my
sequel
database
spin
up
a
part
that
runs
a
my
sequel
database
and
it
front-ends
that
part
with
the
cerise
a
database
service,
and
this
database
service
is
routing
traffic
on
this
IP
address
and
on
port
54:34.
A
By
default,
my
sequel
uses
three
3:06
and
the
part
54-34
is
forwarding
from
3
to
0-6.
So,
as
you
can
see,
the
database
is
now
running
and
it
is
run
tended
by
this
service.
Now,
let's
explore
this
web
console
a
little
bit.
If
you
click
on
this
browse
button,
you
will
see
different
kinds
of
things
that
you
can
look
at.
Let's
look
at
what
pods
are
running.
It's
running
a
database
pod
with
this
name
database,
1x
n
s,
8x
I-
can
also
view
this
from
my
command
line.
A
If
I
say
oh
s,
he
get
parts
like
before.
It'll
show
all
the
parts
that
are
running
so
the
same
database
part
is
running
here.
You
could
also
see
the
service
and
the
IP
address
of
the
service
here
and
the
ports
exposed
by
the
service
now
I'm
going
to
get
inside
this
part
and
add
some
data
to
this
database
like
before
this
time,
I'm
going
to
use
OSC
exec
command.
A
This
will
allow
me
to
enter
inside
the
pot.
I
will
supply
the
pod,
ID
and
I
want
to
enter
the
bash
mop.
So
now,
from
my
local
machine
I'm
entering
inside
the
part
and
I
have
the
bash
prompt
displayed
here
now.
Let's
access
the
my
sequel
database
to
the
IP
address
of
the
service,
the
port
number
exposed
by
the
service
is
5.
4,
3,
4.
A
A
A
As
you
can
see,
the
source
code
is
in
the
form
of
a
PHP
file.
I
have
a
simple
PHP.
This
is
the
same
as
what
we
have
used
in
the
previous
example.
It
will
connect
to
the
database
and
it
will
display
the
list
of
users
from
the
users
table
as
simple
as
that.
So
what
we
are
going
to
do
is
supply
this
source
code
to
open
shift
and
let
it
build
the
image
from
this
source
code.
A
I
am
selecting
a
builder
image,
and
since
this
is
a
PHP
application,
I'm
going
to
select
the
PHP
builder
image
and
I
have
to
name
this
application.
I
am
good
with
DB
test
as
the
name,
and
there
are
a
few
other
parameters
that
you
can
set,
and
this
is
still
evolving.
As
of
now,
you
can
create
a
route
for
this
application,
but
you
can't
edit
it
from
the
console
yet
so
we
are
going
to
add
that
route
manually
outside
can
provide
some
deployment
configurations.
A
We
are
saying
that
it's
it's
going
to
auto
deploy
when
the
new
image
is
available,
the
build
information
it
has
configured
that
the
source
code
is
the
github
repository
URL
that
we
provided
and
it'll
automatically
build
a
new
image.
When
the
code
changes.
It's
yes
and
it's
going
to
automatically
build
a
new
image
from
the
Builder
image
changes
as
well.
A
So
whether
the
source
code
changes
are
the
PHP
itself
changes,
it
will
trigger
a
new
build
and,
let's
all,
let's
say,
I-
add
a
label
here,
we'll
call
it
PHP
front-end
and
then
I
am
going
to
say
create
now
what
this
does
is.
It
will
spin
up
this
DB
test.
Now,
if
you
look
at
the
builds
here,
you
have
a
new
build
called
DB
test
creator
and
it
is
pointing
to
the
source
source
repository
which
is
on
github
and
I
can
start
a
new
bill.
Now.
A
This
I
started
a
new
build
with
the
name
DB
test1,
and
the
build
is
running
here
from
the
command
line.
If
I
say
oh
I
see
get,
various
I
should
see
the
same,
build
again
here
and
if
I
want
to
see
what
is
going
on,
I
can
say:
let's
see,
build
logs
to
look
at
the
blocks,
it
has
actually
pulled
the
source
core.
It
has
converted
the
the
source
code
and
took
the
Builder
image
and
it
built
an
image
for
my
application.
A
Now
it
is
trying
to
push
this
darker
image
for
this
application
into
a
local
registry
that
is
running
in
my
open,
shipped
environment.
This
is
the
local
docker
registry.
That's
in
my
environment,
this
is
taken
going
to
take
a
minute
you
can
see.
This
is
this
has
successfully
pushed
the
image,
and
once
this
image
has
been
pushed,
the
application
image
has
been
deployed
into
a
pod
with
this
ID
that
you
are
seeing
here,
and
this
application
is
now
running
in
a
pod
on
node
2
right
now.
A
So
this
is
the
process
of
source
2
image,
where
you
give
us
a
source
code
and
their
source
code
has
been
converted
into
a
docker
image.
It
has
been
registered
inside
the
docker
registry
that
is
running
on
my
openshift
environment
and
it
has
automatically
taken
that
image
and
deployed
it
into
a
separate
part.
Now
this
part
should
now
talk
to
the
database
part,
but
before
we
check
that
we'll
have
to
add
a
route
to
this
application.
Let's
look
at
the
services
here.
A
You
can
see
that
the
database
service
from
before
is
still
there
and
there
is
a
service
for
the
data
DB
test,
which
is
the
front
end
that
we
created,
but
it
by
default.
It
adds
a
route
here,
but
this
is
not.
This
is
not
useful
at
this
point,
so
what
we
will
do
is
add
an
additional
route
for
this
application
that
is
externally
accessible,
I'm,
going
to
add
this
route
manually
for
now,
and
this
application
will
be
accessible
using
this
URL.
A
By
issuing
this
command,
I
have
created
a
route
for
this
application.
Now
now
you
can
see
that
the
route
is
now
added
now,
let's
access
this
application
using
this
route,
and
here
are
the
two
records
from
the
database.
What
this
means
is
the
front-end
code
that
we
just
added
the
DB
tester
PHP
is
connecting
to
the
database
and
it
has
accessed
the
two
records
that
we
added
before.
So.
A
To
summarize,
what
we
have
learnt
in
this
video
today,
we
have
created
a
project
on
using
open
shifts
web
console,
and
we
have
added
a
database
in
that
project.
By
using
templates,
then
we
have
created
an
application
front-end
that
talks
to
this
database
by
using
the
source
code
and
we
open
shift
by
using
the
source
to
image
conversion
process.
Open
shift
has
converted
that
source
code
into
a
docker
image.