Permalink
Browse files

system comes up, web authentication needs to be updated

  • Loading branch information...
1 parent 887630f commit 62eb8e6a18ca1ac35cd9cc8131923933480cfb58 @grze grze committed Aug 13, 2009
Showing with 135 additions and 97 deletions.
  1. +1 −1 clc/.classpath
  2. +1 −1 clc/build.xml
  3. +1 −2 clc/modules/authentication/src/main/java/com/eucalyptus/auth/CredentialsBootstrapper.java
  4. +3 −3 clc/modules/authentication/src/main/resources/META-INF/persistence.xml
  5. +1 −1 clc/modules/bootstrap/arguments.ggo
  6. +2 −2 clc/modules/bootstrap/eucalyptus-opts.c
  7. +1 −1 clc/modules/bootstrap/eucalyptus-opts.h
  8. +11 −0 clc/modules/cloud/src/main/java/com/eucalyptus/bootstrap/DatabaseConfig.java
  9. +0 −7 clc/modules/cloud/src/main/java/com/eucalyptus/bootstrap/HsqldbBootstrapper.java
  10. +8 −2 clc/modules/cloud/src/main/resources/META-INF/eucalyptus-bootstrap.properties
  11. +2 −8 clc/modules/{core/conf → cloud/src/main/resources/META-INF}/eucalyptus-interface.xml
  12. 0 clc/modules/{core/conf → cloud/src/main/resources/META-INF}/eucalyptus-mule.xml
  13. 0 clc/modules/{core/conf → cloud/src/main/resources/META-INF}/eucalyptus-runtime.xml
  14. 0 clc/modules/{core/conf → cloud/src/main/resources/META-INF}/eucalyptus-services.xml
  15. 0 clc/modules/{core/conf → cloud/src/main/resources/META-INF}/eucalyptus-storage.xml
  16. 0 clc/modules/{core/conf → cloud/src/main/resources/META-INF}/eucalyptus-userdata.xml
  17. 0 clc/modules/{core/conf → cloud/src/main/resources/META-INF}/eucalyptus-verification.xml
  18. +1 −0 clc/modules/cloud/src/main/resources/com.eucalyptus.CloudServiceProvider
  19. +3 −3 clc/modules/core/src/main/resources/META-INF/persistence.xml
  20. +2 −7 clc/modules/core/src/main/resources/log4j.xml
  21. +3 −3 clc/modules/image-manager/src/main/resources/META-INF/persistence.xml
  22. +55 −0 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/BootstrapFactory.java
  23. +7 −13 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/Bootstrapper.java
  24. +0 −31 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/ServiceBootstrapper.java
  25. +19 −5 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/SystemBootstrapper.java
  26. +12 −7 clc/modules/msgs/src/main/resources/eucalyptus-bootstrap.xml
  27. +1 −0 clc/modules/storage-controller/src/main/resources/com.eucalyptus.CloudServiceProvider
  28. +1 −0 clc/modules/storage-manager/src/main/resources/com.eucalyptus.CloudServiceProvider
View
@@ -73,7 +73,7 @@
<classpathentry kind="lib" path="lib/hibernate-commons-annotations-3.0.0.GA+euca1.jar"/>
<classpathentry kind="lib" path="lib/hibernate-connection-c3p0-3.3.1+euca1.jar"/>
<classpathentry kind="lib" path="lib/hibernate-entitymanager-3.4.0.GA+euca1.jar"/>
- <classpathentry kind="lib" path="lib/hsqldb-1.8.0.10.jar"/>
+ <classpathentry kind="lib" path="lib/hsqldb-1.8.0.10.jar" sourcepath="/home/decker/jbproject/hsqldb-1.8.0.10"/>
<classpathentry kind="lib" path="lib/hsqldbutil-1.8.0.10.jar"/>
<classpathentry kind="lib" path="lib/janino-2.5.15-1.jar"/>
<classpathentry kind="lib" path="lib/javassist-3.8.1.jar"/>
View
@@ -181,7 +181,7 @@
<condition property="needUnzipping">
<and>
<not>
- <available file="${deps.lib.dir}/jibx-run*.jar"/>
+ <available file="${deps.lib.dir}/bcprov.jar"/>
</not>
<and>
<available file="${deps.dir}/${deps.lib}.tar.gz"/>
@@ -30,8 +30,7 @@ public boolean load( ) throws Exception {
@Override
public boolean start( ) throws Exception {
- //TODO: this depends on the DB
-// Credentials.checkAdmin( );
+ Credentials.checkAdmin( );
return true;
}
@@ -51,10 +51,10 @@
<property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
<property name="hibernate.connection.url" value="jdbc:hsqldb:hsql://${euca.db.host}:${euca.db.port}/eucalyptus_auth"/>
<property name="hibernate.connection.username" value="sa"/>
- <property name="hibernate.connection.password" value="eucalyptus"/>
- <property name="hibernate.connection.autocommit" value="true"/>
+ <property name="hibernate.connection.password" value="${euca.db.password}"/>
+ <property name="hibernate.connection.autocommit" value="false"/>
<property name="hibernate.c3p0.min_size" value="16"/>
- <property name="hibernate.c3p0.max_size" value="16384"/>
+ <property name="hibernate.c3p0.max_size" value="1024"/>
<property name="hibernate.c3p0.timeout" value="20"/>
<property name="hibernate.c3p0.max_statements" value="0"/>
<property name="hibernate.c3p0.idle_test_period" value="20"/>
@@ -14,7 +14,7 @@ option "err" e "Redirect standard error to file." string typestr="fil
section "Eucalyptus Runtime Options"
option "check" C "Check on Eucalyptus." flag off
option "stop" S "Stop Eucalyptus." flag off
-option "fork" f "Fork and daemonize Eucalyptus." flag on
+option "fork" f "Fork and daemonize Eucalyptus." flag off
option "pidfile" - "Location for the pidfile." string typestr="filename" default="/var/run/eucalyptus-cloud.pid" no
@@ -41,7 +41,7 @@ const char *eucalyptus_opts_help[] = {
"\nEucalyptus Runtime Options:",
" -C, --check Check on Eucalyptus. (default=off)",
" -S, --stop Stop Eucalyptus. (default=off)",
- " -f, --fork Fork and daemonize Eucalyptus. (default=on)",
+ " -f, --fork Fork and daemonize Eucalyptus. (default=off)",
" --pidfile=filename Location for the pidfile. \n (default=`/var/run/eucalyptus-cloud.pid')",
"\nJava VM Options:",
" -j, --java-home=directory Alternative way to specify JAVA_HOME. \n (default=`/usr/lib/jvm/java-6-openjdk')",
@@ -116,7 +116,7 @@ void clear_args (struct eucalyptus_opts *args_info)
args_info->err_orig = NULL;
args_info->check_flag = 0;
args_info->stop_flag = 0;
- args_info->fork_flag = 1;
+ args_info->fork_flag = 0;
args_info->pidfile_arg = gengetopt_strdup ("/var/run/eucalyptus-cloud.pid");
args_info->pidfile_orig = NULL;
args_info->java_home_arg = gengetopt_strdup ("/usr/lib/jvm/java-6-openjdk");
@@ -60,7 +60,7 @@ struct eucalyptus_opts
const char *check_help; /**< @brief Check on Eucalyptus. help description. */
int stop_flag; /**< @brief Stop Eucalyptus. (default=off). */
const char *stop_help; /**< @brief Stop Eucalyptus. help description. */
- int fork_flag; /**< @brief Fork and daemonize Eucalyptus. (default=on). */
+ int fork_flag; /**< @brief Fork and daemonize Eucalyptus. (default=off). */
const char *fork_help; /**< @brief Fork and daemonize Eucalyptus. help description. */
char * pidfile_arg; /**< @brief Location for the pidfile. (default='/var/run/eucalyptus-cloud.pid'). */
char * pidfile_orig; /**< @brief Location for the pidfile. original value given at command line. */
@@ -0,0 +1,11 @@
+package com.eucalyptus.bootstrap;
+
+public class DatabaseConfig {
+ private static String DEFAULT = "CREATE SCHEMA PUBLIC AUTHORIZATION DBA\n" +
+ "CREATE USER SA PASSWORD \"eucalyptus\"\n" +
+ "GRANT DBA TO SA\n" +
+ "SET WRITE_DELAY 10 MILLIS";
+ private String name;
+ private String fileName;
+ //TODO: handle persistence.xml issues here
+}
@@ -15,13 +15,6 @@
public class HsqldbBootstrapper extends Bootstrapper implements Runnable {
private static Logger LOG = Logger.getLogger( HsqldbBootstrapper.class );
private static HsqldbBootstrapper singleton;
- /**
- *
- * ${euca.db.host}
- * ${euca.db.port}
- * ${euca.db.name}
- * ${euca.db.jpaname}
- */
public static HsqldbBootstrapper getInstance( ) {
synchronized ( HsqldbBootstrapper.class ) {
@@ -1,2 +1,8 @@
-euca.services=eucalyptus-cloud-services.xml
-euca.model=eucalyptus-cloud-model.xml
+euca.cloud-model.xml=eucalyptus-cloud-model.xml
+euca.cloud-services.xml=eucalyptus-cloud-services.xml
+euca.interface.xml=eucalyptus-interface.xml
+euca.runtime.xml=eucalyptus-runtime.xml
+euca.services.xml=eucalyptus-services.xml
+euca.storage.xml=eucalyptus-storage.xml
+euca.userdata.xml=eucalyptus-userdata.xml
+euca.verification.xml=eucalyptus-verification.xml
@@ -74,22 +74,16 @@
<payload-type-filter expectedType="edu.ucsb.eucalyptus.msgs.VmSecurityMessage"/>
</filtering-router>
<filtering-router>
- <outbound-endpoint ref="BukkitWS"/>
+ <outbound-endpoint address="vm://Bukkit" synchronous="false"/>
<payload-type-filter expectedType="edu.ucsb.eucalyptus.msgs.WalrusRequestType"/>
</filtering-router>
<filtering-router>
- <outbound-endpoint ref="StorageWS"/>
+ <outbound-endpoint address="vm://Storage" synchronous="false"/>
<payload-type-filter expectedType="edu.ucsb.eucalyptus.msgs.StorageRequestType"/>
</filtering-router>
</outbound>
</service>
- <service name="ReplyQueue">
- <inbound>
- <inbound-endpoint ref="ReplyQueueWS"/>
- </inbound>
- <component class="com.eucalyptus.ws.util.ReplyQueue"/>
- </service>
</model>
</mule>
@@ -81,10 +81,10 @@
<property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
<property name="hibernate.connection.url" value="jdbc:hsqldb:hsql://${euca.db.host}:${euca.db.port}/eucalyptus"/>
<property name="hibernate.connection.username" value="sa"/>
- <property name="hibernate.connection.password" value="eucalyptus"/>
- <property name="hibernate.connection.autocommit" value="true"/>
+ <property name="hibernate.connection.password" value="${euca.db.password}"/>
+ <property name="hibernate.connection.autocommit" value="false"/>
<property name="hibernate.c3p0.min_size" value="16"/>
- <property name="hibernate.c3p0.max_size" value="16384"/>
+ <property name="hibernate.c3p0.max_size" value="1024"/>
<property name="hibernate.c3p0.timeout" value="20"/>
<property name="hibernate.c3p0.max_statements" value="0"/>
<property name="hibernate.c3p0.idle_test_period" value="20"/>
@@ -40,20 +40,15 @@
<param name="Target" value="System.out"/>
<param name="Threshold" value="INFO"/>
<layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="[%c{1}:%t] %m%n"/>
+ <param name="ConversionPattern" value="%d{HH:mm:ss} %5p [%-.20c{1}:%.10t] %m%n"/>
</layout>
</appender>
-
-<!-- <appender name="logfile" class="org.apache.log4j.AsyncAppender">
- <appender-ref ref="rolling-logfile"/>
- </appender>
--->
<appender name="logfile" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="${euca.log.dir}/cloud-debug.log"/>
<param name="MaxFileSize" value="10MB"/>
<param name="MaxBackupIndex" value="10"/>
<layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d{HH:mm:ss} [%c{1}:%t] %x %-5p %m%n"/>
+ <param name="ConversionPattern" value="%d{HH:mm:ss} %5p [%-.20c{1}:%.10t] %m%n"/>
</layout>
</appender>
@@ -52,10 +52,10 @@
<property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
<property name="hibernate.connection.url" value="jdbc:hsqldb:hsql://${euca.db.host}:${euca.db.port}/eucalyptus_volumes"/>
<property name="hibernate.connection.username" value="sa"/>
- <property name="hibernate.connection.password" value="eucalyptus"/>
- <property name="hibernate.connection.autocommit" value="true"/>
+ <property name="hibernate.connection.password" value="${euca.db.password}"/>
+ <property name="hibernate.connection.autocommit" value="false"/>
<property name="hibernate.c3p0.min_size" value="16"/>
- <property name="hibernate.c3p0.max_size" value="16384"/>
+ <property name="hibernate.c3p0.max_size" value="1024"/>
<property name="hibernate.c3p0.timeout" value="20"/>
<property name="hibernate.c3p0.max_statements" value="0"/>
<property name="hibernate.c3p0.idle_test_period" value="20"/>
@@ -0,0 +1,55 @@
+package com.eucalyptus.bootstrap;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+import com.google.common.collect.Lists;
+
+public class BootstrapFactory {
+ private static Logger LOG = Logger.getLogger( BootstrapFactory.class );
+ public static void findAll() {
+ for( ResourceProvider r : ResourceProvider.values( ) ) {
+ r.getProviders( );
+ }
+ }
+ public enum ResourceProvider {
+ SystemCredentials(),
+ Database(),
+ ClusterCredentials(),
+ UserCredentials(),
+ CloudService(),
+ ;
+ private String resourceName;
+ private static Logger LOG = Logger.getLogger( BootstrapFactory.ResourceProvider.class );
+ private ResourceProvider() {
+ this.resourceName = String.format( "com.eucalyptus.%sProvider", this.name( ) );
+ }
+
+ @SuppressWarnings( "static-access" )
+ public List<String> getProviders() {
+ List<String> providers = Lists.newArrayList( );
+ try {
+ Enumeration<URL> p1 = ClassLoader.getSystemClassLoader( ).getResources( this.name( ) );
+ URL u = null;
+ while(p1.hasMoreElements( )) {
+ u = p1.nextElement( );
+ LOG.info( u );
+ }
+ Enumeration<URL> p2 = BootstrapFactory.class.getClassLoader( ).getSystemResources( this.name( ) );
+ while(p1.hasMoreElements( )) {
+ u = p1.nextElement( );
+ LOG.info( u );
+ }
+ } catch ( IOException e ) {
+ e.printStackTrace();
+ }
+ return providers;
+ }
+
+ }
+
+}
@@ -1,18 +1,9 @@
package com.eucalyptus.bootstrap;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-import java.util.Properties;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-
import org.apache.log4j.Logger;
-import org.mule.config.ConfigResource;
-
-import com.google.common.collect.Lists;
public abstract class Bootstrapper {
+
private static Logger LOG = Logger.getLogger( Bootstrapper.class );
public static String BOOTSTRAP_CONFIG_PROPERTY = "euca.bootstrap.config";
public static String BASEDIR = "META-INF/";
@@ -24,10 +15,13 @@
public String getVersion() {
return System.getProperty( VERSION_PROPERTY );
}
+
+// public abstract boolean init() throws Exception;//this is uid 0
+ public abstract boolean load() throws Exception;
+ public abstract boolean start() throws Exception;
public abstract boolean check() throws Exception;
- public abstract boolean destroy() throws Exception;
public abstract boolean stop() throws Exception;
- public abstract boolean start() throws Exception;
- public abstract boolean load() throws Exception;
+ public abstract boolean destroy() throws Exception;
+
}
@@ -1,31 +0,0 @@
-package com.eucalyptus.bootstrap;
-
-import java.util.List;
-
-public class ServiceBootstrapper extends Bootstrapper {
-
- @Override
- public boolean check( ) {
- return false;
- }
-
- @Override
- public boolean destroy( ) {
- return false;
- }
-
- public boolean load( ) {
- return false;
- }
-
- @Override
- public boolean start( ) {
- return false;
- }
-
- @Override
- public boolean stop( ) {
- return false;
- }
-
-}
@@ -26,6 +26,9 @@
private static Logger LOG = Logger.getLogger( SystemBootstrapper.class );
static {
LOG.info( "Loaded Bootstrapper." );
+ System.setProperty( "euca.db.host", "127.0.0.1" );
+ System.setProperty( "euca.db.port", "9001" );
+ System.setProperty( "euca.db.password", "" );
}
private static SystemBootstrapper singleton;
@@ -62,9 +65,10 @@ public boolean stop( ) throws Exception {
@Override
public boolean start( ) throws Exception {
LOG.info( "Starting Eucalyptus." );
+ BootstrapFactory.findAll( );
try {
for ( Bootstrapper b : this.bootstrappers ) {
- LOG.info( "-> Invoking bootsrapper " + b.getClass( ).getSimpleName( ) + ".start()Z" );
+ LOG.info( "-> Invoking bootstrapper " + b.getClass( ).getSimpleName( ) + ".start()Z" );
b.start( );
}
context.start( );
@@ -78,8 +82,20 @@ public boolean start( ) throws Exception {
@SuppressWarnings( "deprecation" )
@Override
public boolean load( ) throws Exception {
+ ClassLoader currentLoader = Thread.currentThread().getContextClassLoader();
+ try {
+ Enumeration resources = currentLoader.getResources("com.eucalyptus.CloudServiceProvider");
+ while (resources.hasMoreElements()) {
+ System.out.println("========================\n\nElements found:" + resources.nextElement() + "\n\n========================");
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ //TODO: discovery persistence contexts
+ //TODO: determine the role of this component
String bootstrapConfig = System.getProperty( Bootstrapper.BOOTSTRAP_CONFIG_PROPERTY );
- if( bootstrapConfig == null ) {
+ Enumeration<URL> test = SystemBootstrapper.class.getClassLoader( ).getResources( "com.eucalyptus.CloudServiceProvider" );
+ if( bootstrapConfig == null || test == null ) {
LOG.fatal( "Bootstrap configuration property is undefined: " + Bootstrapper.BOOTSTRAP_CONFIG_PROPERTY );
return false;
}
@@ -106,16 +122,14 @@ public boolean load( ) throws Exception {
}
}
}
- //load/check credentials
- //bind DNS
try {
LOG.info( "-> Configuring..." );
context = new DefaultMuleContextFactory( ).createMuleContext( new SpringXmlConfigurationBuilder( configs.toArray( new ConfigResource[] {} ) ) );
for ( Bootstrapper b : this.bootstrappers ) {
LOG.info( "-> Found bootsrapper " + b.getClass( ).getSimpleName( ) + ".load()Z" );
}
for ( Bootstrapper b : this.bootstrappers ) {
- LOG.info( "-> Invoking bootsrapper " + b.getClass( ).getSimpleName( ) + ".load()Z" );
+ LOG.info( "-> Invoking bootstrapper " + b.getClass( ).getSimpleName( ) + ".load()Z" );
b.load( );
}
} catch ( Exception e ) {
Oops, something went wrong.

0 comments on commit 62eb8e6

Please sign in to comment.