13 Replies Latest reply on Aug 20, 2008 5:38 PM by brian.stansberry

    Looking at deployment structure - JBAS-5823

    alesj

      I'm done with porting the old deployment structure
      to new ManagedDeployment API:
      - https://jira.jboss.org/jira/browse/JBAS-5823

      But there are a couple of issues:
      1) in order to use this new API, we must run in profileservice configuration
      2) deployment needs to go over DeploymentManager, which copies whole deployment, not what we've done before -> deployed directly from testsuite/output/lib
      3) this API is asynchronous, so testing deployments requires some hacks (Thread sleep + multiple tries)

      I still need to fix ProfileService to properly undeploy/delete newly added deployments.

        • 1. Re: Looking at deployment structure - JBAS-5823
          alesj

           

          "alesj" wrote:

          3) this API is asynchronous, so testing deployments requires some hacks (Thread sleep + multiple tries)

          It's asynch if you forget to add name to DeploymentManager::start :-)

          • 2. Re: Looking at deployment structure - JBAS-5823
            alesj

             

            "alesj" wrote:

            2) deployment needs to go over DeploymentManager, which copies whole deployment, not what we've done before -> deployed directly from testsuite/output/lib

            This way we cannot handle unpacked deployments,
            e.g. unpacked-ear1.ear in PartUnpackedEARDeploymentUnitTestCase.

            URL is pointing to a directory,
            and using its InputStream to copy contents doesn't do anything,
            or at least its not copying contents (which is probably expected for directory).
            [StreamingDeploymentTarget] URL connection: sun.net.www.protocol.file.FileURLConnection:file:/C:/projects/jboss5/trunk/testsuite/output/lib/unpacked-ear1.ear/
            [StreamingDeploymentTarget] InputStream: java.io.ByteArrayInputStream@e99681

            The javadocs for sun.net.www.protocol.file.FileURLConnection are useless.

            • 3. Re: Looking at deployment structure - JBAS-5823
              starksm64

              Its the StreamingDeploymentTarget that is choosing to copy the content to the server. The SerializableDeploymentID representing the deployment has a contentURL that could be used to represent the old style of external deployment that could be added via reference rather than by copy. As long as the url has a usable VirtualFile the PS should not care.

              • 4. Re: Looking at deployment structure - JBAS-5823
                alesj

                 

                "scott.stark@jboss.org" wrote:
                The SerializableDeploymentID representing the deployment has a contentURL that could be used to represent the old style of external deployment that could be added via reference rather than by copy.

                So, how to diff between what PS does now and what we used to do?
                New method?
                Leaving distribute to do current stream copy,
                where reference/xyz would do the old ref style?

                • 5. Re: Looking at deployment structure - JBAS-5823
                  starksm64

                  I think the DeploymentManager.distribute(String name, DeploymentPhase phase, URL contentURL) should become:
                  distribute(String name, DeploymentPhase phase, URL contentURL, boolean copyContent);

                  and DeploymentTarget.distribute(DeploymentID deployment) should become:
                  DeploymentTarget.distribute(DeploymentID deployment, boolean copyContent)

                  The StreamingDeploymentTarget.distribute would then either pass in the stream or just the url via another distribute(DeploymentID) method that would be added to the org.jboss.profileservice.management.upload.remoting.DeployHandler.invoke(InvocationRequest) else clause:

                   else
                   {
                   Map payload = request.getRequestPayload();
                   DeploymentID dtID = (DeploymentID) payload.get("DeploymentTargetID");
                   log.debug("invoke, payload: "+payload+", parameter: "+parameter);
                   if( parameter.equals("distribute"))
                   {
                   DeploymentPhase phase = (DeploymentPhase) payload.get("phase");
                   returnValue = distribute(dtID, phase);
                   }
                   else if( parameter.equals("getRepositoryNames"))
                   {
                   String[] names = (String[]) payload.get("names");
                   DeploymentPhase phase = (DeploymentPhase) payload.get("phase");
                   returnValue = getRepositoryNames(names, phase);
                   }
                   else if( parameter.equals("start") )
                   {
                   start(dtID);
                   }
                   else if( parameter.equals("stop") )
                   {
                   stop(dtID);
                   }
                   else if( parameter.equals("undeploy") )
                   {
                   undeploy(dtID);
                   }
                   }
                  




                  • 6. Re: Looking at deployment structure - JBAS-5823
                    starksm64

                    I added a distribute(DeploymentID deployment) to the DeployHanlder. See if you can wire up the rest and get it to work.

                    • 7. Re: Looking at deployment structure - JBAS-5823
                      alesj

                       

                      "scott.stark@jboss.org" wrote:
                      See if you can wire up the rest and get it to work.

                      Done. ;-)

                      The deployers tests are now ported over to Managed API / ProfileService:
                      - http://lists.jboss.org/pipermail/jboss-cvs-commits/2008-August/070030.html

                      • 8. Re: Looking at deployment structure - JBAS-5823
                        brian.stansberry

                        The testsuite started failing in the tests-clustered-profileservice target around the time of these changes:

                        https://hudson.jboss.org/hudson/job/JBoss-AS-5.0.x-TestSuite-sun15/830/

                        Are either of you looking at this; if not I can have a look later today.

                        • 9. Re: Looking at deployment structure - JBAS-5823
                          alesj

                          You mean org.jboss.test.profileservice.test.DeployUnitTestCase(profileservice).testEjb3xDeployment?
                          This one is failing for a long time and I'll try and fix it in the following days.

                          Or is it something else?
                          Since I saw Scott put back again wrong names
                          for ProfileServiceUnitTestCase::testDeploymentNames.
                          This is now fixed, and the PSUTC passes for me.
                          But can fail due to previous failures; e.g. DeployUnitTestCase failure.

                          • 10. Re: Looking at deployment structure - JBAS-5823
                            brian.stansberry

                            No I meant the testsuite didn't run to completion:

                            tests-clustered-profileservice:
                             .....
                            [server:start] Starting server "cluster-profilesvc-0", with command (start timeout is 120 seconds ):
                            [server:start] /qa/tools/opt/jdk1.5.0_15/bin/java -cp /qa/services/hudson/hudson_workspace/workspace/JBoss-AS-5.0.x-TestSuite-sun15/trunk/build/output/jboss-5.0.0.CR2/bin/run.jar:/qa/tools/opt/jdk1.5.0_15/lib/tools.jar -Xms128m -Xmx512m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true -Djava.endorsed.dirs=/qa/services/hudson/hudson_workspace/workspace/JBoss-AS-5.0.x-TestSuite-sun15/trunk/build/output/jboss-5.0.0.CR2/lib/endorsed -Dresolve.dns=false -Djgroups.udp.ip_ttl=0 -Djboss.messaging.ServerPeerID=0 -Djboss.partition.name=DefaultPartition org.jboss.Main -c cluster-profilesvc-0 -b 10.18.34.175 -u 227.43.0.80
                            [server:start] Starting server "cluster-profilesvc-1", with command (start timeout is 120 seconds ):
                            [server:start] /qa/tools/opt/jdk1.5.0_15/bin/java -cp /qa/services/hudson/hudson_workspace/workspace/JBoss-AS-5.0.x-TestSuite-sun15/trunk/build/output/jboss-5.0.0.CR2/bin/run.jar:/qa/tools/opt/jdk1.5.0_15/lib/tools.jar -Xms128m -Xmx512m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true -Djava.endorsed.dirs=/qa/services/hudson/hudson_workspace/workspace/JBoss-AS-5.0.x-TestSuite-sun15/trunk/build/output/jboss-5.0.0.CR2/lib/endorsed -Dresolve.dns=false -Djgroups.udp.ip_ttl=0 -Djboss.messaging.ServerPeerID=1 -Djboss.partition.name=DefaultPartition org.jboss.Main -c cluster-profilesvc-1 -b 10.18.34.176 -u 227.43.0.80
                            [server:start] Failed to start server "cluster-profilesvc-1" before timeout. Destroying the process.
                            
                            BUILD FAILED
                            /qa/services/hudson/hudson_workspace/workspace/JBoss-AS-5.0.x-TestSuite-sun15/trunk/testsuite/build.xml:935: The following error occurred while executing this line:
                            /qa/services/hudson/hudson_workspace/workspace/JBoss-AS-5.0.x-TestSuite-sun15/trunk/testsuite/imports/config/tests-clustering.xml:337: Error starting server "cluster-profilesvc-1": Server failed to start; see logs.


                            • 11. Re: Looking at deployment structure - JBAS-5823
                              alesj

                              How do I reproduce this?
                              Or you'll have a look?

                              • 12. Re: Looking at deployment structure - JBAS-5823
                                brian.stansberry

                                I'll have a look. I have no idea what the problem is, just that it broke around the time of some commits I think were discussed on this thread, which might be irrelevant. :)

                                • 13. Re: Looking at deployment structure - JBAS-5823
                                  brian.stansberry

                                  Nothing to do with this thread; one of the servers from the previous run didn't stop cleanly. Sorry for the noise.