About Ephemeric Cloud
Ephemeric cloud is a cloud platform for hosting Pharo web applications. The main feature of Ephemeric cloud is REST API which allows you to script an application start in the cloud (for instance, with
Ephemeric cloud is designed to host lots of applications. There are some restrictions applied to the hosted Images though.
- First, an Ephemeric application is "paused" after 30 minutes of inactivity. It means that the Pharo Image is stopped and all the associated resources are removed from the memory. Ephemeric Cloud is designed specially for web solutions hence by "inactivity" it is meant no HTTP requests sent to the Ephemeric. The system automatically starts the Epehemric application upon the next request so for the user it looks like it was never off.
- Second, an Epehemric application is read-only. By this it is meant your Image is not able to write data to a local disk. For instance, you are not able to use Image Persistence or other type of File Persistence for your application. The idea is that published Images are immutable and can be identified by it's content. However the restriction works only for a local disk so your Ephemeric may save data to any remote locations like MongoDB applicance for data, WebDAV appliance for files or other services you prefer.
- Third, an Ephemeric application must be quit-tolerant. As the system stops and starts Images depending on users activity the Image looses it's state on each start/sleep cycle. This means your application must be disigned appropriately and does not store important information in memory.
0 Quick start
Quick start video tutorials:
- Ephemeric cloud account activation
- How to publish Seaside Image Archive (you may find the image archive below)
If you need a test application to publish in the cloud you may use the following one:
1 Access to the Cloud
To get access to the Epehemric Cloud you need to log in to Pharocloud wih your usual credentials then open "Ephemeric" tab and click "Activate". Then the page will create and show your Ephemeric User ID and Auth token. You can use those to work with epehemric REST API or login to "Ephemeric Cloud Client".
Each Pharocloud account is limited to 1 active Ephemeric by default. You can lift the limitiation by changing the Ephemeric Cloud subscription plan.
Please note that User Ephemeric Cloud is limited by concurrently active Ephemeric applications. This means user can upload and use several applications even on a "free plan" until only the one of them is running at a time.
2 Pharo Image Archive File
To package your application for an Ephemeric cloud create an
Image Archive File which is a zip-archive file containing one Pharo Image and other files needed. The system uses
unzip linux utilities to extract Image archive so the default compressing utilities of Windows and Mac OS X should work.
- Image Archive File size limit is set to
- Pharo Image must automatically start a web server on
- Phar Image is started in headless mode with the following command:
# pharo -vm-display-null --headless --encoding UTF-8 "$IMAGE" --no-quit
3 REST API
Ephemeric cloud REST API is a collection of HTTP requests designed to manage your cloud. Requests work with
JSON format to respond your calls.
A user cloud is accessible by REST API at the following API endpoint:
Each request must have
authToken query parameter associated with the user to perform a query.
The REST API represents a user as a collection of ephemerics. Ephemeric instances are identified by the hostname (eg.:
eph-312de9eb.swarm.pharocloud.com). You can get your
userID in Pharocloud Ephemerics account settings.
The list of REST API calls is as follows:
GET /api/ephemerics/user/<userID>gets information about all Ephemerics owned by a userID.
GET /api/ephemerics/user/<userID>/<ephemericHost>gets information about an Ephemeric application which associated with "ephemericHost".
POST /api/ephemerics/user/<userID>creates a new Ephemeric application using Image Archive File which is attached to the query (file field property "imageZip").
DELETE /api/ephemerics/user/<userID>/<ephemericHost>removes Ephemeric with host "ephemericHost" from the cloud.
GET /api/ephemerics/user/<userID>/<ephemericHost>/stopForce pause of the ephemeric instance. Please note that gate cache will not be cleared with force pause which may lead up to 30 secons delay of a start.
4 Using CURL to manage Epehemric Cloud
Get the list of ephemerics owned by a user
NoteEphemeric instances are identified by a hostname. In the example above the user has one ephemeric named
Create a new Ephemeric:
To delete an an Ephemeric instance send DELETE request to an ephemeric node (identified by hostname answered by the create command):
- Video Sceencast: Ephemeric cloud: publishing StoryBoard application with CURL